Text - upload in BDC

Hai everyone,
I have read the sales order text ( mmo3 ) using Read_text and saved it using
Save_text. how can i save it to a flat file??
then how can i upload a text( for sales order txt or Purchase order Text) from a flat file ( for BDC) ?
thank you in advance.
suki.

hi,
For saving to flat file use the FM GUI_DOWNLOAD with filetype as ASC.
and for uploading use FM GUI_UPLOAD.
regards,
Priya.

Similar Messages

  • Regarding  text uploading in bdc

    hi abap groups i am doing text uploding through bdc for c201.i do not know how to use save_text function module.hoping for u r wonderful support.
    regards bala.

    Hi Balachandran,
      This function module writes a text module to the text file or text
      memory, depending on the specific text object.
      The module can be used to change existing texts and to create new texts.
      If it is clear that it is a new text, this can be specified via the
      parameter INSERT. The result is better performance as a test read is not
      performed.
    please check this logic
      DATA: ls_header LIKE thead.
    DATA : BEGIN OF lt_lines OCCURS 0,
              INCLUDE STRUCTURE tline,
            END OF lt_lines.
         CALL FUNCTION 'SAVE_TEXT'
               EXPORTING
                    header          = ls_header
               TABLES
                    lines           = lt_lines
               EXCEPTIONS
                    id              = 1
                    language        = 2
                    name            = 3
                    object          = 4
                    OTHERS          = 5.
    Hope this helps...
    Best regards,
    raam

  • Problem with OPERATION TEXT(LTXA1) uploading using BDC For C202 Transaction

    Hi Experts,
    Im presently doing a BDC for the trransaction C202 (Change Master Recipe),my task was to upload the 'OPERATION TEXT' field PLPOD-LTXA1 which is actually Long text to an existing master recipe from a flat file during updation of the 'OPERATION TEXT the number of lines i was able to were 34 which we number lines on the displayed page and while updating the 35th line using the concept of bdc table control it is failing to insert the update text.
    I used all the ok codes but failed to update more than 34 lines.So,can someone tell me how to update the longtext beyound it.
    This is the Screenshot of my problem:
    [BDC_C202_error|http://www.freeimagehosting.net/uploads/79af6bac49.jpg]
    Thanx in advance.

    Hi,
    There is a better way of doing the long text upload in SAP. In your BDC, if I change the text editor, the BDC will not work.
    Hence ,
    Use function module " Save_Text" to update long texts in SAP.
    Please check its FM documentation or perform a search for this FM in SDN for more clarity.
    Write back in case you face further issues.
    Regards,
    Rijuraj
    Edited by: Rijuraj Raju on Sep 10, 2010 3:05 PM

  • About file uploading in bdc

    hi,
    what is the use of file uploading in bdc.
    i mean that how can i see that my file was updated or not.
    or where updation has happend using this files in both
    session method and call transaction method.
    i hope u can understood my problem.
    hoping for good answer.
    thanks

    TYPE-POOLS : TRUXS.
    TYPES : BEGIN OF TYP_OUT,
      PLVAR(2)  TYPE C,
      OTYPE(2)  TYPE C,
      SEARK(12) TYPE C,
      INFTY(4)  TYPE C,
      SUBTY(4)  TYPE C,
      ISTAT(1)  TYPE C,
      BEGDA(10) TYPE C,
      ENDDA(10) TYPE C,
      RSIGN(1)  TYPE C,
      RELAT(3)  TYPE C,
      SCLAS(2)  TYPE C,
      SOBID(45) TYPE C,
    END OF TYP_OUT.
    DATA : TA_PP02 TYPE STANDARD TABLE OF TYP_OUT INITIAL SIZE 0,
           WA_PP02 TYPE TYP_OUT.
    DATA: TA_EXCEL TYPE STANDARD TABLE OF ALSMEX_TABLINE INITIAL SIZE 0,
           WA_EXCEL TYPE ALSMEX_TABLINE.
    DATA : RAW_DATA TYPE TRUXS_T_TEXT_DATA.
    DATA: TA_BDCDATA TYPE STANDARD TABLE OF BDCDATA ,
           WA_BDCDATA TYPE BDCDATA,
           TA_BDCMESSAGE TYPE TABLE OF BDCMSGCOLL,
           WA_BDCMESSAGE TYPE BDCMSGCOLL.
    SELECTION-SCREEN : BEGIN OF BLOCK BLK1 WITH FRAME TITLE TEXT-001.
    PARAMETERS FILE_N TYPE RLGRAP-FILENAME OBLIGATORY." Path name selected by user with help of Filemngr
    SELECTION-SCREEN : END OF BLOCK BLK1 .
    AT SELECTION-SCREEN ON VALUE-REQUEST FOR FILE_N.
    CALL FUNCTION 'F4_FILENAME'
    EXPORTING
    FIELD_NAME = 'FILE_N'
    IMPORTING
    FILE_NAME = FILE_N.
    START-OF-SELECTION.
    PERFORM UPLOAD.
    PERFORM BDC_OPEN.
    PERFORM BDC_SCREENS .
    PERFORM BDC_CLOSE.
    CALL TRANSACTION 'SM35'.
    *&      Form  UPLOAD
          text
    -->  p1        text
    <--  p2        text
    FORM UPLOAD .
    CALL FUNCTION 'TEXT_CONVERT_XLS_TO_SAP'
      EXPORTING
      I_FIELD_SEPERATOR          =
      I_LINE_HEADER              =
        I_TAB_RAW_DATA             = RAW_DATA
        I_FILENAME                 = FILE_N
      TABLES
        I_TAB_CONVERTED_DATA       = TA_PP02[]
    EXCEPTIONS
       CONVERSION_FAILED          = 1
       OTHERS                     = 2
    IF SY-SUBRC <> 0.
    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
             WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
    ENDIF.
    ENDFORM.                    " UPLOAD
    *&      Form  BDC_OPEN
          text
    -->  p1        text
    <--  p2        text
    FORM BDC_OPEN .
      CALL FUNCTION 'BDC_OPEN_GROUP'
       EXPORTING
         CLIENT                    = SY-MANDT
        DEST                      = FILLER8
         GROUP                     = 'PP02'
        HOLDDATE                  = FILLER8
         KEEP                      = 'X'
         USER                      = SY-UNAME
      IF SY-SUBRC <> 0.
    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
             WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
      ENDIF.
    ENDFORM.                    " BDC_OPEN
    *&      Form  BDC_SCREENS
          text
    -->  p1        text
    <--  p2        text
    FORM BDC_SCREENS .
      LOOP AT TA_PP02 INTO WA_PP02.
        REFRESH TA_BDCDATA.
        PERFORM BDC_DYNPRO      USING 'SAPMH5A0' '1000'.
        PERFORM BDC_FIELD       USING 'BDC_CURSOR'
                                      'PPHDR-ENDDA'.
        PERFORM BDC_FIELD       USING 'BDC_OKCODE'
                                      '/00'.
        PERFORM BDC_FIELD       USING 'PPHDR-PLVAR'
        WA_PP02-PLVAR.
                                 '01'.
        PERFORM BDC_FIELD       USING 'PPHDR-OTYPE'
        WA_PP02-OTYPE.
                                 'S'.
        PERFORM BDC_FIELD       USING 'PM0D1-SEARK'
        WA_PP02-SEARK.
        PERFORM BDC_FIELD       USING 'PPHDR-INFTY'
        WA_PP02-INFTY.
        PERFORM BDC_FIELD       USING 'PPHDR-SUBTY'
        WA_PP02-SUBTY.
        PERFORM BDC_FIELD       USING 'PPHDR-ISTAT'
        WA_PP02-ISTAT.
        PERFORM BDC_FIELD       USING 'PPHDR-BEGDA'
        WA_PP02-BEGDA.
        PERFORM BDC_FIELD       USING 'PPHDR-ENDDA'
        WA_PP02-ENDDA.
        PERFORM BDC_DYNPRO      USING 'SAPMH5A0' '1000'.
        PERFORM BDC_FIELD       USING 'BDC_CURSOR'
                                      'PPHDR-PLVAR'.
        PERFORM BDC_FIELD       USING 'BDC_OKCODE'
                                      '=INSE'.
        PERFORM BDC_FIELD       USING 'PPHDR-PLVAR'
        WA_PP02-PLVAR.
        PERFORM BDC_FIELD       USING 'PPHDR-OTYPE'
        WA_PP02-OTYPE.
        PERFORM BDC_FIELD       USING 'PM0D1-SEARK'
        WA_PP02-SEARK.
        PERFORM BDC_FIELD       USING 'PPHDR-INFTY'
        WA_PP02-INFTY.
        PERFORM BDC_FIELD       USING 'PPHDR-ISTAT'
        WA_PP02-ISTAT.
       PERFORM BDC_FIELD       USING 'PPHDR-BEGDA'
       WA_PP02-BEGDA.
       PERFORM BDC_FIELD       USING 'PPHDR-ENDDA'
       WA_PP02-ENDDA.
      PERFORM BDC_DYNPRO      USING 'MP100100' '2000'.
      PERFORM BDC_FIELD       USING 'BDC_CURSOR'
                                  'P1001-SOBID'.
      PERFORM BDC_FIELD       USING 'BDC_OKCODE'
                                  '/00'.
      PERFORM BDC_FIELD       USING 'P1001-BEGDA' WA_PP02-BEGDA.
                                 '01.12.2009'.
      PERFORM BDC_FIELD       USING 'P1001-ENDDA' WA_PP02-ENDDA.
                                 '31.12.9999'.
      PERFORM BDC_FIELD       USING 'P1001-RSIGN' WA_PP02-RSIGN.
                                 'A'.
      PERFORM BDC_FIELD       USING 'P1001-RELAT' WA_PP02-RELAT.
                                 '002'.
      PERFORM BDC_FIELD       USING 'P1001-SCLAS' WA_PP02-SCLAS.
                                 'S'.
      PERFORM BDC_FIELD       USING 'P1001-SOBID' WA_PP02-SOBID.
                                 '50001923'.
      PERFORM BDC_DYNPRO      USING 'MP100100' '2000'.
      PERFORM BDC_FIELD       USING 'BDC_CURSOR'
                                      'P1001-BEGDA'.
      PERFORM BDC_FIELD       USING 'BDC_OKCODE'
                                      '=UPD'.
      PERFORM BDC_DYNPRO      USING 'SAPMH5A0' '1000'.
      PERFORM BDC_FIELD       USING 'BDC_CURSOR'
                                     'PPHDR-PLVAR'.
      PERFORM BDC_FIELD       USING 'BDC_OKCODE'
                                      '=BACK'.
      CALL FUNCTION 'BDC_INSERT'
      EXPORTING
       TCODE                  = 'PP02'
       TABLES
        DYNPROTAB              = TA_BDCDATA.
    IF SY-SUBRC <> 0.
    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
             WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
    ENDIF.
       PERFORM BDC_TRANSACTION USING 'PP02'.
      ENDLOOP.
    PERFORM CLOSE_GROUP.
    ENDFORM.                    " BDC_SCREENS
    *&      Form  BDC_CLOSE
          text
    -->  p1        text
    <--  p2        text
    FORM BDC_CLOSE .
      CALL FUNCTION 'BDC_CLOSE_GROUP'
       EXCEPTIONS
         NOT_OPEN          = 1
         QUEUE_ERROR       = 2
         OTHERS            = 3
      IF SY-SUBRC <> 0.
    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
             WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
      ENDIF.
    ENDFORM.                    " BDC_CLOSE
    *& Form bdc_dynpro
    *text
    *-->P_1269 text
    *-->P_1270 text
    FORM BDC_DYNPRO USING PROGRAM TYPE SY-REPID
    DYNPRO TYPE ANY.
    WA_BDCDATA-PROGRAM = PROGRAM.
    WA_BDCDATA-DYNPRO = DYNPRO.
    WA_BDCDATA-DYNBEGIN = 'X'.
    APPEND WA_BDCDATA TO TA_BDCDATA.
    CLEAR WA_BDCDATA.
    ENDFORM. " bdc_dynpro
    **& Form bdc_field
    *text
    *-->P_1329 text
    *-->P_1330 text
    FORM BDC_FIELD USING FNAM TYPE ANY
    FVAL TYPE ANY.
    IF FVAL NE ''.
    WA_BDCDATA-FNAM = FNAM.
    WA_BDCDATA-FVAL = FVAL.
    APPEND WA_BDCDATA TO TA_BDCDATA.
    CLEAR WA_BDCDATA.
    ENDIF.
    ENDFORM. " bdc_field

  • How many numbers  of records can be uploaded  using BDC  at a time

    dear friends,
                      i want to know that how many numbers  of records can be uploaded using BDC  at a time from legacy system(database).

    no resticsation.
    large value of data  upload.

  • LSMW for Customer master text upload

    Hi
    I would want to upload the customer master text using LSMW. I see a message type /DSD/HH_CUSTMASTEXT (Customer master additions) being available.
    has anybody used this for text upload??
    I am not sure how it works, i dont see the provision to enter the text unlike the "SAVE_TEXT function module.
    If any one of you have used it, kindly let me know.
    Thanks
    Manju

    Hi Srinivas,
    yes we could do the text upload using direct input method. I need to invoke it from web methods, it would be difficult with direct input method and hence i was looking for using IDOC's.
    Regards
    Manju

  • Data Upload Using BDC

    Hi Friends,
    While creating the task list user defined field is in input mode, but when i do data uploading thru BDC program it's always coming in display mode, so system is not taking the data input for that field.
    Field Name : User Defined Field ( PLPOD-USR00 )
    Kindly suggest the solution.
    Regards
    Pankaj

    Hi ~
    1. Are you  trying bothn online and BDC with the same user id? Please check that if there is any authorization issue.
    2. Some times in BDC the screen flow is different. Check whether there is any difference in the sequence of the screens in between the BDC and online for creating task list.

  • Text uploads, but not images

    Dear Mark: I have a new problem.  I have a new pc and upgraded Dreamweaver CS4. I can connect to server, text uploads, but not pictures.  I also noticed in local files some images dropped out. When I put back and try to upload they will not.
    True Brit

    Oh, my!
    Here's a link referring to the .dll file problem: http://www.windowssupport.org/landing/dll/dll_psmeugs.php?key=dll&gclid=CJXWoZS9v5wCFSdusw od0T3CbA
    Contribute is an application contained in the CS4 Web Suites. I think that the error message you are getting is only 'speculating' on what the problem actually is.
    There is something called a 'clean script' that will help to get rid of extraneous settings. I believe you need to uninstall your CS4, run the clean script, and reinstall CS4, but follow David Powers' resource on that: http://forums.adobe.com/message/1984151#1984151
    Before you go and do this, go into your site definition and turn off all Contribute functionality in Dreamweaver (especially if you are NOT using Contribute).
    It sounds to me as if there is a scrambled installation happening. See what these links can help with.
    And do not hesitate to contact Adobe Installation Support.
    Beth

  • Upload Purchase order text tab using BDC

    Is it possible to upload Purchase order text tab in material master (tcode mm01) using a BDC.
    If so pls tell me how to upload the same, what is the field name of the box.
    Regards,
    Senthil

    u need to use READ_TEXT or SAVE_TEXT or WRITE_TEXT or COMMIT_TEXT to upload text into SAP.

  • Long text uploading problem in BDC

    Hai Gurus
    please help me, it is urgent
    i want to upload more than 200 characters filed from flat file to every inspection lot record usage decision(QA11) through BDC for every inspection lot
    Brief description about my problem:  
    in the transaction QA11 , enter any new inspection lot number and press enter , in this next screen (after pressing enter) in  usage decision sub screen , create long text for UD icon is there in that we can enter long text(any number of characters ) through manually for single inspection lot but i want to enter long text for UD through BDC for more than one inspection lot automatically
    points will be rewarded
    Thanks

    Hai Gurus
    please help me, it is urgent
    i want to upload more than 200 characters filed from flat file to every inspection lot record usage decision(QA11) through BDC for every inspection lot
    Brief description about my problem:  
    in the transaction QA11 , enter any new inspection lot number and press enter , in this next screen (after pressing enter) in  usage decision sub screen , create long text for UD icon is there in that we can enter long text(any number of characters ) through manually for single inspection lot but i want to enter long text for UD through BDC for more than one inspection lot automatically
    points will be rewarded
    Thanks

  • PURCHASE ORDER UPLOAD THRU BDC

    HOW MANY FLAT FILES 'LL U UPLOAD FOR PURCHASE ORDER IN BDC ND BAPI. i.e., WILL U GIVE SEPERATE FILE FOR HEADER DATA AND ITEM DATA OR A SINGLE FILE FOR BOTH. GIVE ME SOME SAMPLE CODES.

    Refer the sample program in BDC:
    *& Report ZTRAINEE15_BDC *
    REPORT ztrainee15_bdc
    NO STANDARD PAGE HEADING LINE-SIZE 255.
    DATA : BEGIN OF itab OCCURS 10,
    orderno LIKE vbak-vbeln,
    itemno LIKE vbap-posnr,
    reason LIKE vbap-abgru,
    END OF itab.
    DATA : BEGIN OF it_bdc OCCURS 10.
    INCLUDE STRUCTURE bdcdata.
    DATA : END OF it_bdc.
    DATA : filename TYPE string.
    DATA: it_bdcmsgcall type standard table of BDCMSGCOLL WITH HEADER LINE.
    *DATA: it_bdcdata type standard table of BDCDATA WITH HEADER LINE.
    SELECTION SCREEN
    SELECTION-SCREEN BEGIN OF BLOCK b1.
    PARAMETER: p_file TYPE rlgrap-filename,
    rjct_itm RADIOBUTTON GROUP g1,
    add_item RADIOBUTTON GROUP g1.
    SELECTION-SCREEN END OF BLOCK b1.
    GUI FOR PATH FILE
    AT SELECTION-SCREEN ON VALUE-REQUEST FOR p_file.
    CALL FUNCTION 'F4_FILENAME'
    EXPORTING
    program_name = syst-cprog
    dynpro_number = syst-dynnr
    field_name = ' '
    IMPORTING
    file_name = p_file.
    UPLOADING FILE
    START-OF-SELECTION.
    filename = p_file.
    CALL FUNCTION 'GUI_UPLOAD'
    EXPORTING
    filename = filename
    filetype = 'ASC'
    HAS_FIELD_SEPARATOR = ' '
    HEADER_LENGTH = 0
    READ_BY_LINE = 'X'
    DAT_MODE = ' '
    CODEPAGE = ' '
    IGNORE_CERR = ABAP_TRUE
    REPLACEMENT = '#'
    IMPORTING
    FILELENGTH =
    HEADER =
    TABLES
    data_tab = itab
    EXCEPTIONS
    file_open_error = 1
    file_read_error = 2
    no_batch = 3
    gui_refuse_filetransfer = 4
    invalid_type = 5
    no_authority = 6
    unknown_error = 7
    bad_data_format = 8
    header_not_allowed = 9
    separator_not_allowed = 10
    header_too_long = 11
    unknown_dp_error = 12
    access_denied = 13
    dp_out_of_memory = 14
    disk_full = 15
    dp_timeout = 16
    OTHERS = 17
    IF sy-subrc 0.
    MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
    WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
    ENDIF.
    *AT SELECTION-SCREEN ON RADIOBUTTON GROUP g1.
    CASE 'rjct_itm'.
    WHEN 'X'.
    PASSING DATA
    program name, screen no.
    LOOP AT itab.
    clear: it_bdc, it_bdc[].
    PERFORM bdc_dynpro USING 'SAPMV45A' '102' 'X'.
    PERFORM bdc_field USING 'BDC_CURSOR' 'VBAK-VBELN'.
    PERFORM bdc_field USING 'BDC_OKCODE' '=SUCH'.
    PERFORM bdc_field USING 'VBAK-VBELN' itab-orderno.
    PERFORM bdc_dynpro USING 'SAPMV45A' '4001' 'X'.
    PERFORM bdc_field USING 'BDC_CURSOR' 'VBAP-POSNR'.
    PERFORM bdc_field USING 'BDC_OKCODE' '=ITEM'.
    PERFORM bdc_field USING 'VBAP-POSNR' itab-itemno.
    PERFORM bdc_dynpro USING 'SAPMV45A' '4003' 'X'.
    PERFORM bdc_field USING 'BDC_CURSOR' 'VBAP-ABGRU'.
    PERFORM bdc_field USING 'BDC_OKCODE' '=SICH'.
    PERFORM bdc_field USING 'VBAP-ABGRU' itab-reason.
    CALLING TRANSACTION
    CALL TRANSACTION 'VA02' USING it_bdc MODE 'A' MESSAGES INTO
    it_bdcmsgcall.
    ENDLOOP.
    LOOP AT it_bdc.
    WRITE: / it_bdc-program,
    it_bdc-dynpro,
    it_bdc-dynbegin,
    it_bdc-fnam,
    it_bdc-fval.
    ENDLOOP.
    *ENDCASE.
    *& Form bdc_dynpro
    text
    -->P_0198 text
    -->P_0199 text
    -->P_0200 text
    FORM bdc_dynpro USING p_program
    p_dynpro
    p_flag.
    it_bdc-program = p_program.
    it_bdc-dynpro = p_dynpro.
    it_bdc-dynbegin = p_flag.
    APPEND it_bdc.
    CLEAR it_bdc.
    ENDFORM. " bdc_dynpro
    *& Form bdc_field
    text
    -->P_0230 text
    -->P_0231 text
    FORM bdc_field USING p_fnam
    p_fval.
    it_bdc-fnam = p_fnam.
    it_bdc-fval = p_fval.
    APPEND it_bdc.
    CLEAR it_bdc.
    ENDFORM. " bdc_field

  • Chinese text upload

    Hi Guys,
    I have requirement to upload material master data in language EN ( English ) and ZF ( chinese)using BDC program . But  I can able to upload data for language EN but ZF when loading MAKTX description is not coming in ZF language .  I have logged in ZF Language and uploaded the data still  i did not found . Could any body suggest me the solution for this .  Is there any prerequisites to taken from MM module end or ABAP end . Please guide me .

    Hi,
    If you are downloading pass the parameter CODEPAGE = '4103'. It should work fine.
    In case of GUI_UPLOAD, first see whether you are able to see the proper characters in your text file. I hope you need to save the text file in unicode format.
    Just copy some chinese characters to textpad and save. You will get a popup. Click cancel and select unicode format and save. Now upload the file. It should work fine.

  • Bom upload using bdc

    While uploading bom using bdc method how to upload item details into subscreen table.explain table control in bdc

    hi,
    When you try to create, you would find a pushbutton 'INSERT NEW LINES' or something simialr to enter your data in the next line. Say you're entering the Material inthe first row, its field position would be MARA-MATNR(01). Now when you click the Insert Pushbitton the cursor always is at positon 2. so you have to loop the remaining data to enter in MARA-MATNR(02). Yougenereally set a counter and pass that counter value (in this case the counter value is 2 always) 
    The other case when you don't have a push button to Insert. Enter all the rows and then do a Page down. Now your cursor would sit back at position 2 again. Say if there are 20 rows in the first screen. You would keep incrementing the counter and then when it is 21 you do a pagedown and then reset the counter to 2. You loop the pagedown and in it you loop the counter. 
    I have attached a BDC where I use the second case (no push button). Do a recording and then you would know all the answers by yourself.
    *&   REPORT ZPP0122                                                    *
    *& Module : PP                                                         |
    *& Application : The program loads the Material Assignment of Routings |
    *&                                                                     |
    REPORT zpp0122 NO STANDARD PAGE HEADING
                                      MESSAGE-ID z0
                                      LINE-SIZE  132
                                      LINE-COUNT 65(2).
                         Internal Tables                                 *
    *Internal table for the Routing fields.
    DATA: BEGIN OF i_rout OCCURS 0,
          plnnr(8),
          plnal(2),
          matnr(18),
          werks(4),
            END OF i_rout.
    DATA:
      g_my_rec_in   LIKE i_rout.
    Declare internal table for Call Transaction and BDC Session
    DATA: i_bdc_table LIKE bdcdata OCCURS 0 WITH HEADER LINE.
                         Global Variables                                *
    DATA: g_counter(2) TYPE n,
          g_field_name(18) TYPE c,
          zc_yes  TYPE syftype VALUE 'X'.
                         Selection Screen                                *
    SELECTION-SCREEN BEGIN OF BLOCK a WITH FRAME TITLE text-001.
    PARAMETERS: p_fname1 TYPE localfile .
    SELECTION-SCREEN SKIP 1.
    SELECTION-SCREEN BEGIN OF BLOCK b WITH FRAME TITLE text-002.
    PARAMETERS: p_rloc1 AS CHECKBOX  DEFAULT 'X'.
    SELECTION-SCREEN BEGIN OF BLOCK c WITH FRAME TITLE text-005.
    PARAMETERS p_group(12) OBLIGATORY DEFAULT 'ZROUTING'.
    SELECTION-SCREEN END OF BLOCK c.
    SELECTION-SCREEN END OF BLOCK b.
    SELECTION-SCREEN END OF BLOCK a.
    **WRITE the report header
    TOP-OF-PAGE.
      INCLUDE zheading.
                         Start of selection                              *
    START-OF-SELECTION.
    Load Input file
      PERFORM f_load_input_file.
    Create BDC records.
      PERFORM create_bdc_records .
    *&      Form  Create_BDC_records
           perform the BDC for the records in the internal table
    FORM create_bdc_records .
      IF NOT i_rout[] IS INITIAL.
    Open BDC session
        PERFORM open_bdc_session.
        LOOP AT i_rout.
          g_my_rec_in = i_rout.
          AT NEW plnnr.
            CLEAR i_bdc_table[].
            PERFORM insert_screen_header.
          ENDAT.
          CONCATENATE 'MAPL-PLNAL('  g_counter  ')' INTO g_field_name.
          PERFORM bdc_field USING g_field_name i_rout-plnal.
          CONCATENATE 'MAPL-MATNR('  g_counter  ')' INTO g_field_name.
          PERFORM bdc_field USING g_field_name i_rout-matnr.
          CONCATENATE 'MAPL-WERKS('  g_counter  ')' INTO g_field_name.
          PERFORM bdc_field USING g_field_name i_rout-werks.
          PERFORM bdc_field USING 'BDC_OKCODE' '/00'.
          g_counter = g_counter + 1.
    Page Down for further entries
          IF g_counter = 19.
            PERFORM bdc_field       USING 'BDC_OKCODE' '=P+'.
            PERFORM bdc_dynpro      USING 'SAPLCZDI' '1010'.
            g_counter = 2.
          ENDIF.
          AT END OF plnnr.
            PERFORM bdc_field       USING 'BDC_OKCODE' '=BACK'.
            PERFORM bdc_dynpro      USING 'SAPLCPDI' '1200'.
            PERFORM bdc_field       USING 'BDC_OKCODE' '=BU'.
            PERFORM insert_bdc_new.
          ENDAT.
        ENDLOOP.
        CLEAR i_rout[].
        PERFORM close_bdc_session.
    Release the BDC sessions created
        PERFORM release_bdc.
      ENDIF.
    ENDFORM.                    " open_group
    *&      Form  bdc_dynpro_start
         Call the screen for the input of fields
         -->P_G_PROGRAM_1
         -->P_G_SCREEN
    FORM bdc_dynpro USING    p_g_program_1
                                    p_g_screen.
      CLEAR i_bdc_table.
      i_bdc_table-program  = p_g_program_1.
      i_bdc_table-dynpro   = p_g_screen.
      i_bdc_table-dynbegin = 'X'.
      APPEND i_bdc_table.
    ENDFORM.                    " bdc_dynpro_start
    *&      Form  bdc_field
           Insert field                                                  *
    FORM bdc_field USING f_name f_value.
    IF f_value <> space.
      CLEAR i_bdc_table.
      i_bdc_table-fnam = f_name.
      i_bdc_table-fval = f_value.
      APPEND i_bdc_table.
    ENDIF.
    ENDFORM.                    "bdc_insert_field
    *&      Form  open_bdc_session
          Create the BDC session
    FORM open_bdc_session .
    Open BDC session and creat and update condition records
      CALL FUNCTION 'BDC_OPEN_GROUP'
        EXPORTING
          client                    = sy-mandt
          DEST                      = FILLER8
          group                     = p_group
          HOLDDATE                  = FILLER8
          keep                      = 'X'
          user                      = sy-uname
          RECORD                    = FILLER1
          PROG                      = SY-CPROG
        IMPORTING
          QID                       =
    EXCEPTIONS
       client_invalid            = 1
       destination_invalid       = 2
       group_invalid             = 3
       group_is_locked           = 4
       holddate_invalid          = 5
       internal_error            = 6
       queue_error               = 7
       running                   = 8
       system_lock_error         = 9
       user_invalid              = 10
       OTHERS                    = 11
      IF sy-subrc <> 0.
        MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
        WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
      ENDIF.
    ENDFORM.                    " create_bdc_session
    *&      Form  insert_screen_header
          Header Data inserted
    FORM insert_screen_header .
      g_counter = 1.
    First screen
      PERFORM bdc_dynpro  USING 'SAPLCPDI' '1010'.
      PERFORM bdc_field   USING 'BDC_CURSOR' 'RC271-PLNNR'.
      PERFORM bdc_field   USING 'BDC_OKCODE' '=ALUE'.
      PERFORM bdc_field   USING 'RC271-PLNNR' g_my_rec_in-plnnr.
      PERFORM bdc_field   USING 'RC27M-MATNR' ' '.
      PERFORM bdc_field   USING 'RC27M-WERKS' ' '.
      PERFORM bdc_field   USING 'RC271-PLNAL' ' '.
    *next screen
      PERFORM bdc_dynpro  USING 'SAPLCPDI' '1200'.
      PERFORM bdc_field   USING 'BDC_OKCODE' '=MTUE'.
    *next screen
      PERFORM bdc_dynpro  USING 'SAPLCZDI' '1010'.
    ENDFORM.                    " insert_screen_header
    *&      Form  insert_bdc
          Insert the BDC for the transaction
    FORM insert_bdc_new .
      CALL FUNCTION 'BDC_INSERT'
         EXPORTING
           tcode                  = 'CA02'
          POST_LOCAL             = NOVBLOCAL
          PRINTING               = NOPRINT
          SIMUBATCH              = ' '
          CTUPARAMS              = ' '
         TABLES
           dynprotab              = i_bdc_table
      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 ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
        WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
      ENDIF.
      CLEAR i_bdc_table[].
    ENDFORM.                    " insert_bdc
    *&      Form  close_bdc_session
          Close the session
    FORM close_bdc_session .
      CALL FUNCTION 'BDC_CLOSE_GROUP'
           EXCEPTIONS
                not_open    = 1
                queue_error = 2
                OTHERS      = 3.
      IF sy-subrc <> 0.
        MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
                WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
      ENDIF.
    ENDFORM.                    " close_bdc_session
    *&      Form  f_load_input_file
         Load the data file
    FORM f_load_input_file.
    The data file is from Presentation server
      IF p_rloc1 = zc_yes.
        CALL FUNCTION 'WS_UPLOAD'
             EXPORTING
                  filename                = p_fname1
                  filetype                = 'DAT'
             TABLES
                  data_tab                = i_rout
             EXCEPTIONS
                  conversion_error        = 1
                  file_open_error         = 2
                  file_read_error         = 3
                  invalid_type            = 4
                  no_batch                = 5
                  unknown_error           = 6
                  invalid_table_width     = 7
                  gui_refuse_filetransfer = 8
                  customer_error          = 9
                  OTHERS                  = 10.
        IF sy-subrc <> 0.
          MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
                  WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
          EXIT.
        ENDIF.
      ENDIF.
    ENDFORM.                    " f_load_input_file
    *&      Form  release_bdc
         Release BDC session
    FORM release_bdc.
      SUBMIT rsbdcsub WITH mappe EQ p_group
                      WITH von EQ sy-datum
                      WITH bis EQ sy-datum
                      WITH fehler EQ '.'
                      EXPORTING LIST TO MEMORY
                      AND RETURN.
    ENDFORM.
    Regards
    Sudheer

  • Error while uploading through bdc

    Hi All,
    While uploading data throgh bdc i am getting error in error file for few employees as " No batch input data for screen SAPLRPBS 2000 " ..what i need to do to solve this problem.
    Thanks.

    Hello absap,
    if your requirement is an enhancement of a program that uses BDC to update OR populate a particular screen,
    set your bdc mode to "A" to display the entire bdc processing.
    you can basically find this in the line:
    CALL TRANSACTION <command>
    USING <bdctab>
    MODE <mode>.     <--- by defualt this should be MODE N.
    the error that you have encountered is due to an UNpopulated REQUIRED field in the screen of the transacation or command you called in the BDC process.
    you can easily trace this error by setting the mode to A to display the bdc process itself.
    alternatively, if you are creating new program, revisit your bdc recording and check if all the required fields are being populated.
    trick:
    when you record in SHDB, open a new window of the transaction.command that you are going to use.
    and from there, populate the fields specified in your requirement and by this, you should not miss any required field in you bdc.
    hope it helps,
    Mark

  • Creating Sales order texts while using BDC session method is not working

    Hi All,
    I have an existing program which creates sales order using BDC session method.( Actual program uses BAPI to create sales order and in case if any error occurs during creation of sales order BDC session is generated so that user can process it later and i am facing issues in this part of code where it uses BDC)
    I wanted to modify this BDC sesion  to update the sales order text also. I tried recording VA01 for creationg sales order text unfortunatly it is not capturing the data i am entering in the text fields.
    Please suggest if there is any way to create sales order using BDC.
    Regards
    Sheeba

    Hi Madhu,
    '=TP_CREATE' is the OK code i am getting for creating TEXTS. But the text entered are not captured in BDC.
    Part of BDC program generated for cretaing sales order texts.
    perform bdc_dynpro      using 'SAPMV45A' '4003'.
    perform bdc_field       using 'BDC_OKCODE'
                                  '=%_GC 128 22'.
    perform bdc_field       using 'LV70T-SPRAS'
                                  'EN'.
    perform bdc_dynpro      using 'SAPMV45A' '4003'.
    perform bdc_field       using 'BDC_OKCODE'
                                  '=TP_CREATE'.
    perform bdc_field       using 'LV70T-SPRAS'
                                  'EN'.
    perform bdc_dynpro      using 'SAPMV45A' '4003'.
    perform bdc_field       using 'BDC_OKCODE'
                                  '=%_GC 128 22'.
    perform bdc_field       using 'LV70T-SPRAS'
                                  'EN'.
    perform bdc_dynpro      using 'SAPMV45A' '4003'.
    perform bdc_field       using 'BDC_OKCODE'
                                  '=TP_CREATE'.
    perform bdc_field       using 'LV70T-SPRAS'
                                  'EN'.
    perform bdc_dynpro      using 'SAPMV45A' '4003'.
    perform bdc_field       using 'BDC_OKCODE'
                                  '/EBACK'.
    perform bdc_field       using 'LV70T-SPRAS'
                                  'EN'.
    perform bdc_dynpro      using 'SAPMV45A' '4001'.
    perform bdc_field       using 'BDC_OKCODE'
                                  '=SICH'.
    Regards,
    Sheeba

Maybe you are looking for

  • How can I see Game of Thrones 3rd seasson with english captions?

    Hey guys, I have bought Game of thrones seasson 3 and it doesn't include captions as the other too. Do you know how can I see Game of Thrones 3rd seasson with english captions? I have download the seasson and trying to play with VLC to add subtitles

  • Can't empty file in trash under 9.2.2 or OS.X.3.9

    I have read the posts and tried the different options of emptying trash and can't get rid of this pesky folder. I was transferring files from a Jaz drive to an internal drive which is titled a workdrive. Some error messages came up that stated certai

  • How to hide parts in a form

    Hi, i am developing a web application which is a form that takes information from the user and stores them in a database. i am using oracle's jdeveloper and they have a render property. i am trying to make the form show fields if a check box is check

  • Parent Child Hierarchies

    Hi All, I am setting up Parent Child Hierarchies in EBS.  Currently, we have all of our base-level child accounts under one parent 'ALL'.  I am trying to expand this having a level of parents underneath 'ALL' such as 'Cash', 'AR', 'Inventory', etc. 

  • How to get desktop notification of e.mails w/o actually opening Thunderbird

    is it possible to receive a tray or other desktop notification when mail arrives without actually having to open Thunderbird and check accounts? I have searched for something that might do this in Thunderbird and my own programme settings but found n