Jun 14, 2012

Create transaction for SAP-Query


By Aswani Bharath. Dell Services  

1)     Open transaction SE93  

2)     Put object name  ,sort text for your transaction

3)     Choose radio button 5. Transaction with parameter.  

4)     Default value for transaction ‘START_REPORT’

5)     In bellow default value section insert default value
           SREPOVARI-REPORTTYPE      = AQ      "Parameter indicating Abap Query
           D_SREPOVARI-REPORT           = ZY_CS_ALLSLS   "Query User group
           D_SREPOVARI-EXTDREPORT= ZY_SLS_MST_001   "Query name  
  

  

6)     Save the transaction.  


8) Execute the transaction.  



Jun 13, 2012

Conversion of IDOC to XML format


By Suresh Parvathaneni and Narasimha Motupalli

This Tutorial details about the step by step in conversion of IDOCs to XML format for further use in XI or any other application. It is assumed that the reader of this Tutorial has some knowledge in ALE, IDOCs and Change Pointers.

Scenario
Conversion of the Material IDOC (Message type: MATMAS) to XML format and store the same in the application server of SAP®.

Approach
Change pointers are used for sending IDOCs for master data like Material Master. To work with Change pointers, following two steps have to be performed:
  • Turn on change pointer update generally
  • Providing the message types to be included for change pointer updation.
 To do the above configurations:
TCode: SALE --> IDOC Interface / Application Link Enabling (SALE) --> Modeling and implementing Business Processes --> Master Data Distribution  --> Replication of Master Data
ALE Configuration Steps:
  1. Creation of logical system for the sender system.
  2. Assignment of logical system to the client.
  3. Create a logical system for the recipient
  4. Creation of RFC destination (Connection type:TCP/IP)
  
  1.  Creation of Model View (TCode: BD64).
  1. Save the Model View and Generate Partner Profiles.
  2. There might be a problem with the automatic Port creation. Creation of the port has to be done manually.
  3. Create an XML Port from the transaction WE21 (Port type: XML File).
Here directory is the path on the application server. The Function Module is used for file naming conventions. Any of the SAP® provided function modules could be used for this (Use F4 help to check on this) or create any custom function module for any other naming conventions.
In the outbound trigger tab, mention the RFC destination created earlier.
  
  1. Make an entry in the partner profile generated earlier for message type MATMAS.
  1. A background job need to be scheduled, for a periodic run (interval as required) for the program RBDMIDOC with the message type MATMAS.
  2. Depending on the settings in the partner profiles, it may be necessary to send IDocs directly by executing the program RSEOUT00 (if the setting is to “Collect IDocs”)
Test the above scenario by creating a material using MM01. An XML file would have been created in the directory specified in the XML port. The file could be downloaded onto the front-end system using the transaction CG3Y.



Jun 5, 2012

Restrict Select-Options in SAP ABAP





  • Use SELECT_OPTIONS_RESTRICT function module to make use of SELECT-OPTIONS easier on the selection screen
  • This function module simplifies the handling of SELECT-OPTIONS on the selection screen by restricting possible selection options and signs. By calling this function module, you can restrict the number of selectio options available for the chosen selection field. You can also disable the function allowing users to enter values to be excluded from the selection (SIGN = 'E'). The set of options (and signs) listed here can be extended for the 'multiple selection' screen.
  • Call function module at INITIALIZATION event. 
REPORT ztest_restrict_so.

TYPE-POOLS:sscr.
TABLES : pa0001.
"Selection-screen
SELECT-OPTIONS :
     s_pernr FOR pa0001-pernr.
"Types
TYPES:
      ty_so_restrict TYPE sscr_restrict,
      ty_so_opt_list TYPE sscr_opt_list,
      ty_sscr_ass    TYPE sscr_ass.
"Work areas
DATA:
      wa_so_restrict TYPE ty_so_restrict,
      wa_so_opt_list TYPE ty_so_opt_list,
      wa_sscr_ass    TYPE ty_sscr_ass.
"Internal tables
DATA:
      it_so_restrict TYPE ty_so_restrict,
      it_so_opt_list TYPE ty_so_opt_list.


INITIALIZATION.

  wa_so_opt_list-name = 'OBJECTKEY1'.
  wa_so_opt_list-options-eq = 'X'.
  wa_so_opt_list-options-bt = 'X'.
  APPEND wa_so_opt_list TO it_so_restrict-opt_list_tab.

  wa_sscr_ass-kind    = 'S'.
  wa_sscr_ass-name    = 'S_PERNR'.
  wa_sscr_ass-sg_main = 'I'.
  wa_sscr_ass-sg_addy = space.
  wa_sscr_ass-op_main = 'OBJECTKEY1'.
  APPEND wa_sscr_ass TO it_so_restrict-ass_tab.

  CALL FUNCTION 'SELECT_OPTIONS_RESTRICT'
    EXPORTING
      restriction            = it_so_restrict
    EXCEPTIONS
      too_late               = 1
      repeated               = 2
      selopt_without_options = 3
      selopt_without_signs   = 4
      invalid_sign           = 5
      empty_option_list      = 6
      invalid_kind           = 7
      repeated_kind_a        = 8
      OTHERS                 = 9.
  IF sy-subrc <> 0.
    MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
            WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
  ENDIF.

Jun 3, 2012

Append Structure to SAP Standard Table LIPS

It is a standard procedure tadd new custom fields to the standard tables.
Append structure name should begin with ZZ or YY. This prevents name conflicts with fields inserted in the table by SAP.

Open LIPS table and click on Append structure.




Click on Create button as below



Provide structure name starts with ZZ or YY.



Give the Field name and data element and save and activate.



Usually it takes time ans its depends on data in the table.




Ref: http://mysaptechnical.blogspot.com/2010/08/append-sap-standard-table.html



Jun 1, 2012

Transaction Code for Table Maintenance Generator

Transaction Code for Table Maintenance Generator

1. Call transaction 'SE93' (Create Transaction)



2. Input Transaction Name



3. Choose Radiobutton Transaction with Parameters



4. Fill up Transaction: SM30, Check 'Skip Initial Screen' and 'Inherit GUI Attributes'



5. Fill up Name of screen and value:
VIEWNAME and 'Table View Name'
UPDATE and 'X'



6. Save..




Ref: http://an-sap-consultant.blogspot.com/2010/12/abap-how-to-create-transaction-code-for.html