Lsmw  step by step procedure using   batch input method

hi,
lsmw  step by step procedure using   batch input method

Step-by-Step Guide for using BAPI in LSMW
Note! The screen prints in this article are from ECC 5.0. They may differ slightly in other versions.
Introduction:
This document details the usage of BAPI in LSMW. We have used the example of migration of the purchase order data into SAP.
Pre-requisites:
It is assumed that the reader of this article has the minimum knowledge required on the Business Object, BAPI, Message Types and IDoc Types.
Step-by-Step Procedure:
Details of the BAPI used in this scenario:
Business Object: BUS2012
Method: CreateFromData
Details of Message Type and Basic IDoc Type:
Message Type: PORDCR
Basic IDoc Type: PORDCR02
Let’s have a look at the BAPI first, before proceeding to the LSMW:
1. Go to Transaction BAPI
2. Click on Search Button
3. Enter the value “BUS2012” and select “Obj.type(Technical Object Name”
4. Press ENTER
5. Following screen appears:
6. On the left side of the screen, Expand the “PurchaseOrder”.
7. Select “PurchaseOrder” and double-click on the same for details.
Building LSMW using BAPI:
1. Go to Transaction LSMW.
2. Enter the Project, Subproject and Object information and click on CREATE.
3. Enter the descriptions for Project, Subproject and Object.
4. Now select Settings à IDoc Inbound Processing
5. “IDoc Inbound Processing” screen appears. Enter the required details as shown below:
6. Click on “Activate IDoc Inbound Processing”.
7. Click on “Yes” when prompted for “Activate IDoc Inbound?”
8. Hit on “Back” to return to the main screen.
9. Click on Continue (F8). Following Screen appears:
10. Select the Step 1 “Maintain Object Attributes” and select “Execute”.
11. Select the radio button “Business Object Method” and enter the following details:
Business Object: BUS2012
Method: CreateFromData
Hit ENTER
12. Save and click on BACK button. Following information message is displayed.
13. Now select step 2 “Maintain Source Structures” and click “Execute”.
14. In this step, we need to maintain the source structure. In our example, lets consider the example of a file with 2 structures Head and Item data as shown below:
Click on Create and name the source structure as HEADERDATA. Now select HEADERDATA and click on “Create” again to create the child structure. Following popup appears:
Select “Lower Level” and click on Continue. Enter the Item data structure name.
Click Save and hit BACK button to go to the main screen.
15. Select step 3 “Maintain Source Fields” and hit execute.
16. Enter the fields as shown below:
17. Click SAVE and return to main screen.
18. Select step 4 “Maintain Structure Relations” and click Execute.
Select E1PORDCR and click on CREATE RelationShip. Following screen appears:
Select HEADERDATA and hit ENTER
Similarly do the same for the structure E1BPEKKOA, E1BPEKPOC and E1BPPEKET.
Click Save and return to main screen.
19. Select the step “Maintain Field Mapping and Conversion Rules” and click on execute. Maintain the Field Mapping as seen below:
20. Select step 7 “Maintain Source Files” and provide the link for the test file created. (Create a test file with the same structure as defined earlier).
Save and return to main screen.
21. Select the step “Assign Files” and click on Execute.
Assign the file provided to the source structure. Here the same file is provided for both the structures.
Save and return to the main screen.
22. Select the step “Read Data” and click on Execute.
Click on Execute.
Return to the main screen.
23. Select the step “Display read data” and click on execute.
Click on the structure name to get the field level values.
24. Return to main screen and now select “Convert Data”.
25. Return to the main screen and select “Display Converted data”.
26. Return to main screen and select “Start IDoc generation”.
27. Now select the step “Start IDoc Processing” on the main screen.
28. Return to main screen and click on “Create IDoc overview”. Here the data record and status records of the IDoc could be viewed
It is given in screen shot.
http://www.****************
http://www.sapbrainsonline.com/TUTORIALS/TECHNICAL/LSMW_tutorial.html
http://www.sapbrain.com/TOOLS/LSMW/SAP_LSMW_steps_introduction.html
http://esnips.com/doc/8e732760-5548-44cc-a0bb-5982c9424f17/lsmw_sp.ppt
http://esnips.com/doc/f55fef40-fb82-4e89-9000-88316699c323/Data-Transfer-Using-LSMW.zip
http://esnips.com/doc/1cd73c19-4263-42a4-9d6f-ac5487b0ebcb/LSMW-with-Idocs.ppt
http://esnips.com/doc/ef04c89f-f3a2-473c-beee-6db5bb3dbb0e/LSMW-with-BAPI.ppt
http://esnips.com/doc/7582d072-6663-4388-803b-4b2b94d7f85e/LSMW.pdf
Reward points if useful.

Similar Messages

  • Criteria to use batch input method in lsmw

    in lsmw we hav batch input method,direct input,idocs,bapis,what is the criteria to use them?

    •     Decide whether it makes sense to use this tool with respect to the data volume to be transferred. It may be easier to transfer very small data volumes into the SAP system manually. In the case of a very large data volume, batch input or IDoc techniques may cause extremely long runtimes. A rough landmark for estimating the required time: 10 000 records per hour where this value may vary considerably depending on the hardware available.
    •     Identify the transaction(s) in the SAP system via which you want to import the data into your SAP system. It may be relevant whether you need the data for statistical analysis or for further processing in the system.
    •     Run the relevant transaction in the SAP system manually with test data from the legacy system and see which fields must be filled. There may be required fields that do not correspond to data fields in the legacy system. In such a case, you should better assign a fixed value or establish an optional field for data transfer.
    santhosh

  • PO creation using LSMW through batch input method

    Hi, I am new to working with LSMW and i have completed a project for creating purchase orders using the direct data input method. I need to do the same using batch input method, however in the maintain structure relationship step, it is only allowing me to assign one structure to the recording that i have done, however in po creation we need separate (nested) structure for header and line item, could anybody help me past this please?

    Hi Rudra!
    OK, now you just know, why you have only one line, not multiple PO item lines. To get a dynamic number of items, you need a complex program - just like standard direct input.
    If you need a field, which is not part of this program, don't try to write your own program for batch input - it's just to much work before you have a good result.
    You can use Bapi method instead with BAPI_PO_CREATE1. This can handle a lot of fields and there is some documentation available how to fill the Bapi.
    If this looks to complicated in the first moment, think about creation of POs via direct input and a small batch recording to change your additional field(s) afterwards. (You can select EKPO table to generate list of 'wrong' migrated orders for input in LSMW.) Use field 'Item' in the bottom of ME22 to position your desired line in first screen line, just change one PO-line after one other (every time a 'save' -> no problem with different number of lines / PO).
    Regards,
    Christian

  • Physical inventory With the help of Batch input method

    Dear all;
    Can anyone tell me the procedure of Physical inventory procedure with batch input method ?
    kindly Give me the step .
    Thanking you;
    Regarsds;
    Joydeep mukherjee

    Hi,
    Go through this following code,
    selection-screen begin of block B2 with frame title TEXT-005.
    selection-screen begin of line.
    parameters:     P_BIRPT type C radiobutton group RAD1 default 'X' user-command UCOMM.
    selection-screen comment 3(20) TEXT-002 for field P_BIRPT.
    selection-screen end of line.
    selection-screen begin of line.
    parameters:     P_COLRPT type C radiobutton group RAD1.
    selection-screen comment 3(20) TEXT-003 for field P_COLRPT.
    selection-screen end of line.
    selection-screen begin of line.
    parameters:     P_PAYRPT type C radiobutton group RAD1.
    selection-screen comment 3(20) TEXT-004 for field P_PAYRPT.
    selection-screen end of line.
    selection-screen end   of block B2.
    selection-screen begin of block B1 with frame title TEXT-001.
    select-options: SO_KTOKD for  KNA1-KTOKD modif id M4,
              SO_BLART for  BSIS-BLART modif id M2.
    parameters:     P_PAID   type ZCLEAR     modif id M3 as listbox visible length 20.
    selection-screen end   of block B1.
    at selection-screen output.
      loop at screen.
        if P_BIRPT eq 'X'.
          if SCREEN-GROUP1   = 'M2' or SCREEN-GROUP1 = 'M3' .
            SCREEN-INVISIBLE = '1'.
            SCREEN-ACTIVE    = '0'.
            modify screen.
          endif.
        elseif P_COLRPT eq 'X'.
          if SCREEN-GROUP1   = 'M3'.
            SCREEN-INVISIBLE = '1'.
            SCREEN-ACTIVE    = '0'.
            modify screen.
          endif.
        elseif P_PAYRPT eq 'X'.
          if SCREEN-GROUP1   = 'M2'.
            SCREEN-INVISIBLE = '1'.
            SCREEN-ACTIVE    = '0'.
            modify screen.
          endif.
          if SCREEN-GROUP1   = 'M4'.
            SCREEN-INVISIBLE = '1'.
            SCREEN-ACTIVE    = '0'.
            modify screen.
          endif.
        endif.
      endloop.
    Thanks
    Anil D

  • LSMW for  Vendor Master using Batch Input/Direct

    Hi Folk,
    I'm trying to create a LSMW for  Vendor Master using Batch Input/Direct Input and in the step Create Batch Inout Session a error message appears:
    Trans.     1 XK01: Acct already exists; general area not being processed.
    Can somebody help me with this...........

    Hi,
    Check manually create vendor. Check with recording steps means strucutre creadred while you choose BDC recording option. With same data r u able to create vendor.
    Regards
    Md.MahaboobKhan

  • WITH LSMW USING BATCH INPUT/DIRECT INPUT/BAPI/IDOCS

    IN WHAT SCENARIOS CAN WE USE BATCH INPUT/DIRECT INPUT/BAPI/IDOCS WITH LSMW.WHICH IS THE BEST ONE.PLEASE TELL ME THE SCENARIOS OF USAGE.

    It really depends on what you are doing.  There are a lot of "standard" LSMW objects for different business objects, for example, there is a std object for Creating Material Masters, in this case, it is a direct input program. So, the best choice here would be to use the standard program which has been provided, it just so happens that it is a direct input program.  Creating Bill of Materials is another one, but this one is a batch input program, so you have no choice but to go with that.  Of course if there is a BAPI for your business object that would be the next best thing, if a standard object does not exists.
    REgards,
    Rich Heilman

  • LSMW for material master using Batch input recording method

    Dears,
    I am using Batch input recording method to upload material master data. But while selecting views , I need to scroll to select the vies lets say Plant storage loc view. While scrolling and selecting ,views are not recorded propelry . That is when I run in foreground system selects only basic data and purchasing views but the plant data views are not selected(palnt data views are selected by scrolling while recording).
    How to resolve this issue.
    Pls help
    Regards
    Kamesh

    HI,
    , I need to scroll to select the vies lets say Plant storage loc view. While scrolling and selecting ,views are not recorded propelry
    Don,t scroll use Page down button from key Bord
    like select Basis view and then press page down button from key board ,then you will get next view now select it
    Regards
    Kailas Ugale

  • Assigning details in RSBBS using batch input (SHDB). Line selection problem

    Hello, Experts!
    While trying to use batch input by transation recording in SHDB I faced the problem of selecting line.
    The scenario was as follows:
    1. create new record in SHDB, transation "RSBBS", asynchronous, no catt, default size checked.
    2. Start recording:
    2.1 Select sender (query)
    2.2 Create receiver (java-application)
    2.3 Select line with receiver in table
    2.4 assign details
    2.5 Save
    When I got the record it contains no action for line selection and when I play the record I get the  error: "Line is not selected".
    How could I define line selection in the bdc-script manually or may be there are some other way to rich the goal - to create a pack of recivers for s sender and to assing details (in my case they are common for all recievers) for each of the reciver?
    Hope for your help.
    Best regards,
    Jozef

    There is no magic in here. The number lines that you see online may not necessarily be the same as what you get in batch. This is because, online, the SAPGUI can be formatted by the user, so the number of lines you can see can vary by the user.
    To overcome this problem, most BDC that have table controls/step-loops are done by using a feature provided within the transaction. This feature enables you to add the new line always at a constant position. In MB11, you can achieve this by pressing 'New Item' after every item. That will enable you to enter the new item always in the first line/position. So you can keep your position as 1 always.
    Instead of BDC, why don't you use BAPI_GOODSMVT_CREATE.
    If this helps, please reward and close the post.
    Thanks,
    Srinivas

  • Difference between batch input method and batch input recording in LSMW?

    hi,
    plz tell me the difference between batch input method and batch input recording in LSMW?
    thanks & regards
    Ruban

    Hi Ruban,
               The main difference between the two is in lsmw we can view the code status at any time just by coming to prvious steps, but whereas in batch input method unless the recording is finished we cant view the code.
    second diff is tht we need to do lot of coding in batch inptu whereas here in lsmw we need not do much coding and mapping to data.
    third diff is that batch input is both inbound and outbound where as lsmw is only inbound.
    hope u got the differences.....
    Regards,
    sana M...

  • Using Direct input method(LSMW)Can I upload only 3 fields for MM01

    Using Direct input method(LSMW)Can I upload only Matnr,mbrsh,mtart fields for MM01.Otherwise I have to give all the mandatory fields.?

    Hello TJK,
    LSMW will work in the same way as you create normal material master with the transactions, here you are giving the value through flat file and creating material master with program.
    You can create only one view with LSMW but you need to give all mandatory field on that particular view, so if you have only these three field as mandatory then yes it is possible, if you have any more field mandatory addition to these fields then it will not work out, during the last step it will throw error saying "maintain the value for field XXX"
    Hope this helps.
    Regards
    Arif Mansuri

  • Difference between batch input method and direct input method in LSMW.

    Hi all,
    what is difference between batch input method and direct input method in LSMW. are they same?if differences are there tell me with details?

    Hi,
    Here are few differences bw Batch Input and Direct Inputs methods.
    Batch Input: Uses classical BDC approach, but doesn't required an ABAP program to be written to format the BDC DATA. The user has to format the data using predefined structures and store it in a flat file. Yet it is a slower updation method.
    Direct Input: Works similar to Batch Input programs. The difference is, instead of processing screens they validate fields and directly load the data into tables using standard function modules. Much faster and suits for large volume of data.
    Thanks.
    DhanaLakshmi M S

  • BDC programming using Batch input Session.

    Hello Experts.
    I'm an ABAP beginner. I've benn practicing BDC programming using Batch input Session
    at the moment.
    This is the program that upload Local file which has plural records, and put the records into a Session.
    These are the records.
    413459,KIM EI HWAN121                ,19810607,MIADONG1234
    423459,KIM EI HWAN122                ,19810607,MIADONG1235
    433459,KIM EI HWAN123                ,19810607,MIADONG1236
    443459,KIM EI HWAN124                ,19810607,MIADONG1237
    453459,KIM EI HWAN125                ,19810607,MIADONG1238
    463459,KIM EI HWAN126                ,19810607,MIADONG1239
    I succeeded making Session.
    However, for some reaseon, every record in the Session has got the same, value which is the first record.
    Why is this happening? And How can I correct the code below?
    REPORT ZBCUSER002_BATCH NO STANDARD PAGE HEADING
                            LINE-SIZE 255
                            MESSAGE-ID ZBATCH.
    = Types definition ===================================================
    TYPES: BEGIN OF TYP_LOCAL,               "For Local file upload
             RECORD(200) TYPE C,
           END   OF TYP_LOCAL.
    = Internal table definition ==============================================
    DATA: BEGIN OF BDC_TAB OCCURS 0.        "BDCDATA itab
            INCLUDE STRUCTURE BDCDATA.
    DATA: END   OF BDC_TAB.
    DATA: BEGIN OF MESSAGE_BDC OCCURS 0.    "Message itab
            INCLUDE STRUCTURE BDCMSGCOLL.
    DATA: END   OF MESSAGE_BDC.
    DATA: TBL_LOCAL TYPE STANDARD TABLE OF TYP_LOCAL,  "Local file itab
          F_TBL     TYPE FILETABLE.                    "FILETABLE fot local
    = Structure table definition =========================================
    DATA: STR_F_TBL LIKE LINE OF F_TBL,                "FILETABLE structure
          STR_LOCAL TYPE TYP_LOCAL.                    "Local file structure
    = Variable definition ================================================
    DATA: LV_RC     TYPE I,                            "Method parameter
          ENUMBER   TYPE ZT601-ENUMBER,                "Employee number
          NAME      TYPE ZT601-NAME,                   "Employee name
          BIRTH     TYPE ZT601-BIRTH,                           "Birthday
          HOMETOWN  TYPE ZT601-HOMETOWN,                        "Hometown
          SYSVAL    TYPE SY-SUBRC.                     "System valuible
    = Constants definition ===============================================
    CONSTANTS: TBL_NAME(10) TYPE C VALUE 'ZT601'.      "Table name ZT601
    = Parameters definition ==============================================
    PARAMETERS: F_NAME      TYPE RLGRAP-FILENAME OBLIGATORY,    "File path
                EXECMODE(1) TYPE C.                    "Execute mode
    INITIALIZATION
    *----- Initialize all valuables, structures and internal tables
    CLEAR: LV_RC,
           STR_F_TBL,
           STR_LOCAL,
           ENUMBER,
           NAME,
           BIRTH,
           HOMETOWN.
    REFRESH: F_TBL,
             TBL_LOCAL.
    AT SELECTION-SCREEN
    *----- When the button next to Parameter 'F_NAME',
    *----- File dialog open.
    AT SELECTION-SCREEN ON VALUE-REQUEST FOR F_NAME.
      CALL METHOD CL_GUI_FRONTEND_SERVICES=>FILE_OPEN_DIALOG
        EXPORTING
          WINDOW_TITLE            = 'SELECT FILE'
          DEFAULT_FILENAME        = '*.TXT'
       CHANGING
         FILE_TABLE               = F_TBL
         RC                       = LV_RC
        EXCEPTIONS
          FILE_OPEN_DIALOG_FAILED = 1
          CNTL_ERROR              = 2
          OTHERS                  = 3
    *----- system valiable check.
    *----- If done properly,
    *----- Put the path into the File path parameter
      IF SY-SUBRC = 0.
        READ TABLE F_TBL INTO STR_F_TBL INDEX 1.
        F_NAME = STR_F_TBL.
    *----- If not done properly, show message
    *----- An error occured while getting file path then end program
      ELSE.
        MESSAGE E000.
      ENDIF.
    *----- Execute code can only be A or N.
    AT SELECTION-SCREEN ON EXECMODE.
      IF EXECMODE <> 'A' AND EXECMODE <> 'N'.
        MESSAGE E001.
      ENDIF.
    START-OF-SELECTION
    START-OF-SELECTION.
    *----- Upload Local file of file path parameter.
      CALL FUNCTION 'GUI_UPLOAD'
           EXPORTING
                FILENAME                = F_NAME
                FILETYPE                = 'ASC'
           TABLES
                DATA_TAB                = TBL_LOCAL
           EXCEPTIONS
                FILE_OPEN_ERROR         = 1
                FILE_READ_ERROR         = 2
                NO_BATCH                = 3
                GUI_REFUSE_FILETRANSFER = 4
                INVALID_TYPE            = 5
                OTHERS                  = 6.
    *----- System valiable check.
    *----- If not done properly, show an error message
    *----- An error occured while uploading local file then end program
      IF SY-SUBRC <> 0.
        MESSAGE E002.
      ENDIF.
      PERFORM BDC_OPEN.
    *----- Loop Internal table
      LOOP AT TBL_LOCAL INTO STR_LOCAL.
    *----- Spilt the file record and put them into each valiable.
        SPLIT STR_LOCAL AT ',' INTO  ENUMBER
                                     NAME
                                     BIRTH
                                     HOMETOWN.
    *----- Data check Function module
        CALL FUNCTION 'DATE_CHECK_PLAUSIBILITY'
             EXPORTING
                  DATE                      = BIRTH
             EXCEPTIONS
                  PLAUSIBILITY_CHECK_FAILED = 1
                  OTHERS                    = 2.
    *----- When error occurs while checking date, show an error message.
    *----- (&1) is not date
        IF SY-SUBRC <> 0.
          MESSAGE E003 WITH BIRTH.
        ENDIF.
    *-- The first screen of SE11
    *----- Screen number 0102 of program id SAPMSRD0
        PERFORM BDC_DYNPRO      USING 'SAPMSRD0' '0102'.
        PERFORM BDC_FIELD       USING 'BDC_CURSOR'
                                      'RSRD1-TBMA_VAL'. "Field on Cursor
        PERFORM BDC_FIELD       USING 'BDC_OKCODE'
                                      '=SHOW'.          "Display button
        PERFORM BDC_FIELD       USING 'RSRD1-TBMA'
                                      'X'.
        PERFORM BDC_FIELD       USING 'RSRD1-TBMA_VAL'
                                       TBL_NAME.                "ZT601
    *-- Table definition screen
    *----- Screen number 2000 of program id SAPLSD02
        PERFORM BDC_DYNPRO      USING 'SAPLSD02' '2000'.
        PERFORM BDC_FIELD       USING 'BDC_CURSOR'
                                      'DD02D-TABCLTEXT'.  "Field on Cursor
        PERFORM BDC_FIELD       USING 'BDC_OKCODE'
                                      '=TDED'.            "Create entry
        PERFORM BDC_FIELD       USING 'BDC_SUBSCR'
                                      'SAPLSD02'.
        PERFORM BDC_FIELD       USING 'BDC_SUBSCR'
                                      'SAPLSED5'.
    *-- Data input screen
    *----- Screen number 0101 of program /1BCDWB/DBZT601
        PERFORM BDC_DYNPRO      USING '/1BCDWB/DBZT601' '0101'.
        PERFORM BDC_FIELD       USING 'BDC_CURSOR'
                                      'ZT601-CRUSER'.    "Field on Cursor
        PERFORM BDC_FIELD       USING 'BDC_OKCODE'
                                      '=SAVE'.                  "Save
        PERFORM BDC_FIELD       USING 'ZT601-MANDT'
                                      SY-MANDT.                 "Client
        PERFORM BDC_FIELD       USING 'ZT601-ENUMBER'
                                      ENUMBER.           "Employee number
        PERFORM BDC_FIELD       USING 'ZT601-NAME'
                                      NAME.              "Employee name
        PERFORM BDC_FIELD       USING 'ZT601-BIRTH'
                                      BIRTH.                    "Birthday
        PERFORM BDC_FIELD       USING 'ZT601-HOMETOWN'
                                      HOMETOWN.                 "Hometown
        PERFORM BDC_FIELD       USING 'ZT601-CRDATE'
                                      SY-DATUM.          "System date
        PERFORM BDC_FIELD       USING 'ZT601-CRTIME'
                                      SY-UZEIT.          "System time
        PERFORM BDC_FIELD       USING 'ZT601-CRUSER'
                                      SY-UNAME.          "System user
    *-- Data input screen (After input)
    *----- Screen number 0101 of program /1BCDWB/DBZT601
        PERFORM BDC_DYNPRO      USING '/1BCDWB/DBZT601' '0101'.
        PERFORM BDC_FIELD       USING 'BDC_OKCODE'
                                      '/EBACK'.                 "Back
        PERFORM BDC_FIELD       USING 'BDC_CURSOR'
                                      'ZT601-CRUSER'.    "Field on Cursor
    *-- Table definition screen]
    *----- Screen number 2000 of program SAPLSD02
        PERFORM BDC_DYNPRO      USING 'SAPLSD02' '2000'.
        PERFORM BDC_FIELD       USING 'BDC_CURSOR'
                                      'DD02D-TABCLTEXT'.  "Field on Cursor
        PERFORM BDC_FIELD       USING 'BDC_OKCODE'
                                      '=WB_BACK'.               "Back
    *-- The first screen of SE11
    *----- Screen number 0102 of program SAPMSRD0
        PERFORM BDC_DYNPRO      USING 'SAPMSRD0' '0102'.
        PERFORM BDC_FIELD       USING 'BDC_CURSOR'
                                      'RSRD1-TBMA_VAL'.   "Field on Cursor
        PERFORM BDC_FIELD       USING 'BDC_OKCODE'
                                      '=BACK'.
        PERFORM BDC_FIELD       USING 'RSRD1-TBMA'
                                      'X'.
        PERFORM BDC_FIELD       USING 'RSRD1-TBMA_VAL'
                                      TBL_NAME.
        PERFORM BDC_INSERT.
      ENDLOOP.
      PERFORM BDC_CLOSE.
          FORM BDC_DYNPRO                                               *
          Put Program-Id, Dynpro screen number, Start point
          into DBCDATA
    -->  PROGRAM                                                       *
    -->  DYNPRO                                                        *
    FORM BDC_DYNPRO USING PROGRAM DYNPRO.
      CLEAR BDC_TAB.
      BDC_TAB-PROGRAM  = PROGRAM.
      BDC_TAB-DYNPRO   = DYNPRO.
      BDC_TAB-DYNBEGIN = 'X'.
      APPEND BDC_TAB.
    ENDFORM.
          FORM BDC_FIELD                                                *
          Put Field Name and Value into BDCDATA
    -->  FNAM                                                          *
    -->  FVAL                                                          *
    FORM BDC_FIELD USING FNAM FVAL.
      CLEAR BDC_TAB.
      BDC_TAB-FNAM = FNAM.
      BDC_TAB-FVAL = FVAL.
      APPEND BDC_TAB.
    ENDFORM.
          FORM bdc_process                                              *
    FORM BDC_OPEN.
      CALL FUNCTION 'BDC_OPEN_GROUP'
           EXPORTING
                CLIENT = SY-MANDT
                GROUP  = 'Testsession'
                KEEP   = 'X'
                USER   = SY-UNAME.
      IF SY-SUBRC <> 0.
        MESSAGE E006 WITH SY-SUBRC.
      ENDIF.
    ENDFORM.
          FORM bdc_insert                                               *
    FORM BDC_INSERT.
      CALL FUNCTION 'BDC_INSERT'
           EXPORTING
                TCODE            = 'SE11'
           TABLES
                DYNPROTAB        = BDC_TAB
           EXCEPTIONS
                INTERNAL_ERROR   = 1
                NOT_OPEN         = 2
                QUEUE_ERROR      = 3
                TCODE_INVALID    = 4
                PRINTING_INVALID = 5
                POSTING_INVALID  = 6
                OTHERS           = 7.
      IF SY-SUBRC <> 0.
        MESSAGE E007 WITH SY-SUBRC.
      ENDIF.
      CLEAR: BDC_TAB.
    ENDFORM.
          FORM bdc_close                                                *
    FORM BDC_CLOSE.
      CALL FUNCTION 'BDC_CLOSE_GROUP'
           EXCEPTIONS
                NOT_OPEN    = 1
                QUEUE_ERROR = 2
                OTHERS      = 3.
      IF SY-SUBRC <> 0.
        MESSAGE E008 WITH SY-SUBRC.
      ENDIF.
    ENDFORM.

    God I forgot to refresh Internal table after putting record into Session.
    Now I'm done.
    You guys be careful too.

  • Delete services folder using Batch input

    Hi,
    I want to delete a services folder in ME32K using batch input.
    When I try to make it, a dump occurred with this error "OBJECTS_OBJREF_NOT_ASSIGNED" CX_SY_REF_IS_INITIALC
    I tried to find between SAP Notes but I didn't find any solutions.
    Could you help me?
    Thanks a lot
    Melissa

    God I forgot to refresh Internal table after putting record into Session.
    Now I'm done.
    You guys be careful too.

  • Problem in batch input method

    Hi wizards,
    please help me for the following problem:
    I have created a parent recording for MATERIAL MASTER in LSMW batch input method by selecting all of the fields that may be required for different material types.  Now I want to edit the recording and create new recordings from the parent one for specific material types.  For this, i have made a copy of the same recording with a different name in the same project.  In the copied recording, i have kept only the screen fields which i require for a particular material type and deleted the rest. I have created new structure relationships and field mapping rules for the new recording. Now when i upload the data, system is behaving normally upto the DISPLAY READ DATA stage, but gives a short dump on CONVERT DATA. On inspection i have found that during FIELD MAPPING, the _source field mapping is still showing mapping with the source structure of the parent recording for fields which have mapping rule as "Transfer" but it is picking up the new source structure for those source fields for which mapping rule is "Constant"_.
    Kindly help me solve this problem as i do not want to create a separate recording for each material type. Can creating a new subproject help in this regard?
    Thanks and regards
    Abhik

    Hi Harris,
    could you please let me know how to use the two methods you have mentioned? If you have any docs regarding the same then could you please mail it to me at [email protected]? Or else if you have any link for the same then please do send it to me.
    However, I would like to know that if separate recording is required for every material type, then why the "COPY RECORDING" and "DELETE SCREENFIELD" utilities have been provided.
    Thanks and regards
    Abhik

  • LSMW dump with '/' for PRODPER field  for AR load using Batch input.

    I am getting an dump saying
    Unable to interpret "/" as a number for  IF BBSEG-PRODPER(1)           
    which is last field in the lsmw .
    I defaulted to 200810 and also tried with blank and 102008 even though the dump exists.
    let me know .any clue

    BBSEG is intended for Batch Input, there should be only CHAR fields in it, if the field is a standard one look for OSS notes related, if it belongs to a customer include, correct your include (or CI include like CI_COBL_BI) as suggested in OSS notes mentioned above and use a char field with the length of the external format (e.g. 10 for date, etc.)
    The IF BBSEG-PRODPER(1) syntax is presupposing a CHAR field, but when the ABAP executes it first check the whole field BBSEG-PRODPER, and if this is not a CHAR field you got a conversion error. A "patch" solution would be to use CATCH SYSTEM-EXCEPTIONS CONVERSION_ERRORS = 1.  / ENDCATCH to catch the runtime error. You could also bypass the problem by redefining the field as char, use OVERLAY of FIELD-SYMBOLS for that.
    Regards

Maybe you are looking for