Uploading info records by using BDC

Hi all,
Does any one having knowledge in uploading info records (ME11) by using BDC.
Problem arises when going for multiple scales.
Can any one let me know how proceed this BDC.
Regards,
Raj

Goto transaction SHBD enter a recording name and specify the transaction code.
Enter the test data and save it , it will actomatically create a bdc program.
now select that recording name and click create program icon and specify the program name.
This is the program which was created using transaction SHDB for XD01.
include bdcrecx1.
parameters: dataset(132) lower case.
DO NOT CHANGE - the generated data section - DO NOT CHANGE ***
If it is nessesary to change the data section use the rules:
1.) Each definition of a field exists of two lines
2.) The first line shows exactly the comment
'* data element: ' followed with the data element
which describes the field.
If you don't have a data element use the
comment without a data element name
3.) The second line shows the fieldname of the
structure, the fieldname must consist of
a fieldname and optional the character '_' and
three numbers and the field length in brackets
4.) Each field must be type C.
Generated data section with specific formatting - DO NOT CHANGE ***
data: begin of record,
data element: KUN16
KUNNR_001(016),
data element: BUKRS
BUKRS_002(004),
data element: VKORG
VKORG_003(004),
data element: VTWEG
VTWEG_004(002),
data element: SPART
SPART_005(002),
data element: KTOKD
KTOKD_006(004),
data element: ANRED
ANRED_007(015),
data element: NAME1_GP
NAME1_008(035),
data element: SORTL
SORTL_009(010),
data element: NAME2_GP
NAME2_010(035),
data element: STRAS_GP
STRAS_011(035),
data element: PFACH
PFACH_012(010),
data element: ORT01_GP
ORT01_013(035),
data element: PSTLZ
PSTLZ_014(010),
data element: ORT02_GP
ORT02_015(035),
data element: PFORT_GP
PFORT_016(035),
data element: PSTL2
PSTL2_017(010),
data element: LAND1_GP
LAND1_018(003),
data element: REGIO
REGIO_019(003),
data element: SPRAS
SPRAS_020(002),
data element: TELX1
TELX1_021(030),
data element: TELF1
TELF1_022(016),
data element: TELFX
TELFX_023(031),
data element: TELF2
TELF2_024(016),
data element: TELTX
TELTX_025(030),
data element: TELBX
TELBX_026(015),
data element: URL
KNURL_027(132),
data element: STCD1
STCD1_028(016),
data element: STCD2
STCD2_029(011),
data element: BBBNR
BBBNR_030(007),
data element: BBSNR
BBSNR_031(005),
data element: BUBKZ
BUBKZ_032(001),
data element: BRSCH
BRSCH_033(004),
data element: LZONE
LZONE_034(010),
data element: KUKLA
KUKLA_035(002),
data element: BRSCH
BRSCH_036(004),
data element: UMSA1
UMSA1_037(020),
data element: UWAER
UWAER_038(005),
data element: UMJAH
UMJAH_039(004),
data element: JMZAH
JMZAH_040(006),
data element: JMJAH
JMJAH_041(004),
data element: BANKS
BANKS_01_042(003),
data element: BANKK
BANKL_01_043(015),
data element: BANKN
BANKN_01_044(018),
data element: ABLAD
ABLAD_01_045(025),
data element: KNKAL
KNFAK_01_046(002),
data element: CIVVE
CIVVE_047(001),
data element: ANRED_AP
ANRED_01_048(030),
data element: ANRED_AP
ANRED_02_049(030),
data element: NAMEV_VP
NAMEV_01_050(035),
data element: NAMEV_VP
NAMEV_02_051(035),
data element: NAME1_GP
NAME1_01_052(035),
data element: NAME1_GP
NAME1_02_053(035),
data element: TELF1
TELF1_01_054(016),
data element: TELF1
TELF1_02_055(016),
data element: ABTNR_PA
ABTNR_01_056(004),
data element: ABTNR_PA
ABTNR_02_057(004),
data element: AKONT
AKONT_058(010),
data element: DZTERM
ZTERM_059(004),
data element: MAHNA
MAHNA_060(004),
data element: BZIRK
BZIRK_061(006),
data element: AWAHR
AWAHR_062(003),
data element: WAERS_V02D
WAERS_063(005),
data element: KALKS
KALKS_064(001),
data element: LPRIO
LPRIO_065(002),
data element: KZAZU_D
KZAZU_066(001),
data element: ANTLF
ANTLF_067(001),
data element: PERFK
PERFK_068(002),
end of record.
End generated data section ***
start-of-selection.
perform open_dataset using dataset.
perform open_group.
do.
read dataset dataset into record.
if sy-subrc <> 0. exit. endif.
perform bdc_dynpro using 'SAPMF02D' '0100'.
perform bdc_field using 'BDC_CURSOR'
'RF02D-KTOKD'.
perform bdc_field using 'BDC_OKCODE'
'/00'.
perform bdc_field using 'RF02D-KUNNR'
record-KUNNR_001.
perform bdc_field using 'RF02D-BUKRS'
record-BUKRS_002.
perform bdc_field using 'RF02D-VKORG'
record-VKORG_003.
perform bdc_field using 'RF02D-VTWEG'
record-VTWEG_004.
perform bdc_field using 'RF02D-SPART'
record-SPART_005.
perform bdc_field using 'RF02D-KTOKD'
record-KTOKD_006.
perform bdc_dynpro using 'SAPMF02D' '0110'.
perform bdc_field using 'BDC_CURSOR'
'KNA1-KNURL'.
perform bdc_field using 'BDC_OKCODE'
'/00'.
perform bdc_field using 'KNA1-ANRED'
record-ANRED_007.
perform bdc_field using 'KNA1-NAME1'
record-NAME1_008.
perform bdc_field using 'KNA1-SORTL'
record-SORTL_009.
perform bdc_field using 'KNA1-NAME2'
record-NAME2_010.
perform bdc_field using 'KNA1-STRAS'
record-STRAS_011.
perform bdc_field using 'KNA1-PFACH'
record-PFACH_012.
perform bdc_field using 'KNA1-ORT01'
record-ORT01_013.
perform bdc_field using 'KNA1-PSTLZ'
record-PSTLZ_014.
perform bdc_field using 'KNA1-ORT02'
record-ORT02_015.
perform bdc_field using 'KNA1-PFORT'
record-PFORT_016.
perform bdc_field using 'KNA1-PSTL2'
record-PSTL2_017.
perform bdc_field using 'KNA1-LAND1'
record-LAND1_018.
perform bdc_field using 'KNA1-REGIO'
record-REGIO_019.
perform bdc_field using 'KNA1-SPRAS'
record-SPRAS_020.
perform bdc_field using 'KNA1-TELX1'
record-TELX1_021.
perform bdc_field using 'KNA1-TELF1'
record-TELF1_022.
perform bdc_field using 'KNA1-TELFX'
record-TELFX_023.
perform bdc_field using 'KNA1-TELF2'
record-TELF2_024.
perform bdc_field using 'KNA1-TELTX'
record-TELTX_025.
perform bdc_field using 'KNA1-TELBX'
record-TELBX_026.
perform bdc_field using 'KNA1-KNURL'
record-KNURL_027.
perform bdc_dynpro using 'SAPMF02D' '0120'.
perform bdc_field using 'BDC_CURSOR'
'KNA1-LZONE'.
perform bdc_field using 'BDC_OKCODE'
'/00'.
perform bdc_field using 'KNA1-STCD1'
record-STCD1_028.
perform bdc_field using 'KNA1-STCD2'
record-STCD2_029.
perform bdc_field using 'KNA1-BBBNR'
record-BBBNR_030.
perform bdc_field using 'KNA1-BBSNR'
record-BBSNR_031.
perform bdc_field using 'KNA1-BUBKZ'
record-BUBKZ_032.
perform bdc_field using 'KNA1-BRSCH'
record-BRSCH_033.
perform bdc_field using 'KNA1-LZONE'
record-LZONE_034.
perform bdc_dynpro using 'SAPMF02D' '0125'.
perform bdc_field using 'BDC_CURSOR'
'KNA1-JMJAH'.
perform bdc_field using 'BDC_OKCODE'
'/00'.
perform bdc_field using 'KNA1-KUKLA'
record-KUKLA_035.
perform bdc_field using 'KNA1-BRSCH'
record-BRSCH_036.
perform bdc_field using 'KNA1-UMSA1'
record-UMSA1_037.
perform bdc_field using 'KNA1-UWAER'
record-UWAER_038.
perform bdc_field using 'KNA1-UMJAH'
record-UMJAH_039.
perform bdc_field using 'KNA1-JMZAH'
record-JMZAH_040.
perform bdc_field using 'KNA1-JMJAH'
record-JMJAH_041.
perform bdc_dynpro using 'SAPMF02D' '0130'.
perform bdc_field using 'BDC_CURSOR'
'KNBK-BANKN(01)'.
perform bdc_field using 'BDC_OKCODE'
'=ENTR'.
perform bdc_field using 'KNBK-BANKS(01)'
record-BANKS_01_042.
perform bdc_field using 'KNBK-BANKL(01)'
record-BANKL_01_043.
perform bdc_field using 'KNBK-BANKN(01)'
record-BANKN_01_044.
perform bdc_dynpro using 'SAPMF02D' '0130'.
perform bdc_field using 'BDC_CURSOR'
'KNBK-BANKS(01)'.
perform bdc_field using 'BDC_OKCODE'
'=ENTR'.
perform bdc_dynpro using 'SAPMF02D' '0340'.
perform bdc_field using 'BDC_CURSOR'
'KNVA-KNFAK(01)'.
perform bdc_field using 'BDC_OKCODE'
'=ENTR'.
perform bdc_field using 'KNVA-ABLAD(01)'
record-ABLAD_01_045.
perform bdc_field using 'KNVA-KNFAK(01)'
record-KNFAK_01_046.
perform bdc_dynpro using 'SAPMF02D' '0340'.
perform bdc_field using 'BDC_CURSOR'
'RF02D-KUNNR'.
perform bdc_field using 'BDC_OKCODE'
'=ENTR'.
perform bdc_dynpro using 'SAPMF02D' '0370'.
perform bdc_field using 'BDC_CURSOR'
'KNA1-CIVVE'.
perform bdc_field using 'BDC_OKCODE'
'=ENTR'.
perform bdc_field using 'KNA1-CIVVE'
record-CIVVE_047.
perform bdc_dynpro using 'SAPMF02D' '0360'.
perform bdc_field using 'BDC_CURSOR'
'KNVK-ABTNR(02)'.
perform bdc_field using 'BDC_OKCODE'
'=ENTR'.
perform bdc_field using 'KNVK-ANRED(01)'
record-ANRED_01_048.
perform bdc_field using 'KNVK-ANRED(02)'
record-ANRED_02_049.
perform bdc_field using 'KNVK-NAMEV(01)'
record-NAMEV_01_050.
perform bdc_field using 'KNVK-NAMEV(02)'
record-NAMEV_02_051.
perform bdc_field using 'KNVK-NAME1(01)'
record-NAME1_01_052.
perform bdc_field using 'KNVK-NAME1(02)'
record-NAME1_02_053.
perform bdc_field using 'KNVK-TELF1(01)'
record-TELF1_01_054.
perform bdc_field using 'KNVK-TELF1(02)'
record-TELF1_02_055.
perform bdc_field using 'KNVK-ABTNR(01)'
record-ABTNR_01_056.
perform bdc_field using 'KNVK-ABTNR(02)'
record-ABTNR_02_057.
perform bdc_dynpro using 'SAPMF02D' '0360'.
perform bdc_field using 'BDC_CURSOR'
'KNVK-NAMEV(01)'.
perform bdc_field using 'BDC_OKCODE'
'=ENTR'.
perform bdc_dynpro using 'SAPMF02D' '0210'.
perform bdc_field using 'BDC_CURSOR'
'KNB1-AKONT'.
perform bdc_field using 'BDC_OKCODE'
'/00'.
perform bdc_field using 'KNB1-AKONT'
record-AKONT_058.
perform bdc_dynpro using 'SAPMF02D' '0215'.
perform bdc_field using 'BDC_CURSOR'
'KNB1-ZTERM'.
perform bdc_field using 'BDC_OKCODE'
'/00'.
perform bdc_field using 'KNB1-ZTERM'
record-ZTERM_059.
perform bdc_dynpro using 'SAPMF02D' '0220'.
perform bdc_field using 'BDC_CURSOR'
'KNB5-MAHNA'.
perform bdc_field using 'BDC_OKCODE'
'/00'.
perform bdc_field using 'KNB5-MAHNA'
record-MAHNA_060.
perform bdc_dynpro using 'SAPMF02D' '0230'.
perform bdc_field using 'BDC_CURSOR'
'KNB1-VRSNR'.
perform bdc_field using 'BDC_OKCODE'
'/00'.
perform bdc_dynpro using 'SAPMF02D' '0310'.
perform bdc_field using 'BDC_CURSOR'
'KNVV-WAERS'.
perform bdc_field using 'BDC_OKCODE'
'/00'.
perform bdc_field using 'KNVV-BZIRK'
record-BZIRK_061.
perform bdc_field using 'KNVV-AWAHR'
record-AWAHR_062.
perform bdc_field using 'KNVV-WAERS'
record-WAERS_063.
perform bdc_field using 'KNVV-KALKS'
record-KALKS_064.
perform bdc_dynpro using 'SAPMF02D' '0315'.
perform bdc_field using 'BDC_CURSOR'
'KNVV-LPRIO'.
perform bdc_field using 'BDC_OKCODE'
'/00'.
perform bdc_field using 'KNVV-LPRIO'
record-LPRIO_065.
perform bdc_field using 'KNVV-KZAZU'
record-KZAZU_066.
perform bdc_field using 'KNVV-ANTLF'
record-ANTLF_067.
perform bdc_dynpro using 'SAPMF02D' '0320'.
perform bdc_field using 'BDC_CURSOR'
'KNVV-PERFK'.
perform bdc_field using 'BDC_OKCODE'
'/00'.
perform bdc_field using 'KNVV-PERFK'
record-PERFK_068.
perform bdc_dynpro using 'SAPMF02D' '1350'.
perform bdc_field using 'BDC_CURSOR'
'RF02D-KUNNR'.
perform bdc_field using 'BDC_OKCODE'
'=ENTR'.
perform bdc_dynpro using 'SAPMF02D' '0324'.
perform bdc_field using 'BDC_CURSOR'
'KNVP-PARVW(01)'.
perform bdc_field using 'BDC_OKCODE'
'=ENTR'.
perform bdc_transaction using 'XD01'.
enddo.
perform close_group.
perform close_dataset using dataset.
Reward if found helpful....
Cheers,
Chandra Sekhar.

Similar Messages

  • LSMW FOR UPLOADING INFO RECORD-ME11 USING RECODING METHOD

    Hi Guys,
    I am uploading inforecords using LSMW recording method.
    While recording I entered net price and other things properly.
    When I am running the lsmw, net price filed becoming gray(Non editable) filed and system shows error as "it is not an input filed". But if i try to execute the t-code sepeartely this filed is in editable mode.
    Please let me know what is the priblem.
    Thanks
    Dhanu

    Hi Dhanu,
    there is the easiest method to do that you can follow the Direct input method the object for info record id 0060 and program is RM06IBI0,
    With this method you will not get any problems. it is SAP recommended method.
    Bhima

  • Problem with uploading data from excel using BDC for tcode f-02

    Hi All,
    I am uploading data from excel using BDC for tcode f-02. The problem here is, while recording, the values of some fields are recording twice. I dont know why it's happening so. But if I run my abap program, I have to give those fields twice in my excel sheet. Otherwise data does not upload. But it is not the feasible way. We must give those fields once in excel. Please tell me, how I can solve the issue.
    With regards,
    Rosaline.

    Hi,
      in BDC each and every action is recording. If your press enter in same screen that also recorded once aging may be this is your case repeating field values will appear. we can solve the problem for repeat fields like below.
    suppose in your excel having repeated field X1 X2 X3 the X2 contains repeated field X3 means delete the X3 field.
    Now In your itab having X1 and X2 fields. While in the LOOP the ITAB pass the X2 field to repeated the fields.
    LOOP at ITAB to WA.
    CLEAR bdcdata_wa.
    bdcdata_wa-fnam = 'BDC_CURSOR'.
    bdcdata_wa-fval = 'RM08M-EBELN'.
    APPEND bdcdata_wa TO bdcdata_tab.
    CLEAR bdcdata_wa.
    bdcdata_wa-fnam = 'INVFO-BLDAT'.
    bdcdata_wa-fval = wa-X2." 1st time pass the X2 fields
    APPEND bdcdata_wa TO bdcdata_tab.
    CLEAR bdcdata_wa.
    bdcdata_wa-fnam = 'INVFO-BLDAT'.
    bdcdata_wa-fval = wa-X2." pass the same value to repeated field
    APPEND bdcdata_wa TO bdcdata_tab.
    Endloop.
    Hope you can understand.
    Regards,
    Dhina..

  • Data upload for vendor balances using BDC

    hi abap experts,
    I have a requirement on data uploading using BDC.
    For the vendor balances ie. for transaction FBL1N  ( I was given a template for vendor balance upload and need to write a BDC program for that ) I need upload the exsisting transaction data to the system. is recording necessary for this?
    can u pls help me with step by step process for vendor balance uploading.
    Thanks,
    Hema.

    Hi
    Please follow the following Steps:
    Steps for recording:
    Step1: Goto TCODE SHDB
    Step2: Click on New Recording
    Step3: Give the necessary Details such as TOCDE, Desc, ...
    Step4: Do the screen by screen recording.(Please avoid extra screen to appear)
    Step5: Save the recording.
    Step6. Select the recording and click on Program button on toolbar.
    Step7: Give the Program name and click on radio button Transfer from recording.
    Step 8: It will open a new session with SE38 and a program with the recoding.
    Step 9: then just add the basic code for BDC.
    Regards,
    Lokesh

  • Problem in uploading material master data using BDC?

    Hi all,
    I am using  BDC call transaction method to upload material data. Here i am facing a problem that a value in the flat file is going to the wrong screen field . But my recording done properly.
    In recording, after entering the data in the view BASIC DATA1 and trying to enter the text . For this i need to scroll down the scroll bar and after that i am clicking on basic data text and entering the text. Here i am not touching the languge field.
    But the problem is the text to be entered into the basic data text is storing in language and giving error.
    Please help me by specifying the reason and solution for this problem? Whether i did any mistake in recording in scrolling?
    Thanks,
    Vamshi.

    Hi
    Go with BAPI for such huge transactions and screens. Use BAPI: BAPI_MATERIAL_SAVEDATA.
    Regards,
    Vishwa.

  • How to upload a excel file using BDC

    how should i upload a file using BDC
    i have downloaded a excel file containing the values of  table A006 a X server.
    now i hav to upload it into new server Y server using BDC , how do i do it?
    wat all things one shud consider ?

    Hi,
    This is very simple, follow the below mention steps to do so:
    1.Declare an internal table having same structure as db table, but take all the fields type as 'C' and length same as defined in the table.
    TYPES:BEGIN OF it,
      key(20) TYPE c,
      indicator(20) TYPE c,
      bldat(20) TYPE c,"bkpf-bldat
      budat(20) TYPE c,"bkpf-budat
      END OF it.
    DATA: itab TYPE STANDARD TABLE OF it,
          wa TYPE it.
    2.Include TRUX as type pool and declare a variable of type trux_t_text_data to be passed in the FM that actually reads data from excel sheet into above declared intrenal table.
    TYPE-POOLS: truxs.
    DATA: it_raw TYPE truxs_t_text_data.
    3. Call the FM 'TEXT_CONVERT_XLS_TO_SAP' and pass the file name and the internal table name into the parameter
    CALL FUNCTION 'TEXT_CONVERT_XLS_TO_SAP'
        EXPORTING
    *    I_FIELD_SEPERATOR          = 'X'
         i_line_header              = 'X'
          i_tab_raw_data             = it_raw
          i_filename                 = p_file "name of the excel file
        TABLES
          i_tab_converted_data       = itab[] "internal table where data will be stored
       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.
    4. loop at internal table and modify the ztable/dbtable where data to be upload .
    Hope this solve your problem.
    Pooja

  • Info Records Update using BAPI/FM

    Please reply if you know any BAPI/FM to update Purchasing INFO records INCO terms. It's essential that the BAPI or FM should write to change log as well.
    Thanks,
    Kiran

    Figured it on my own

  • Doubt in uploading purchase order data using BDC

    Hi friends,
    how to upload purchase order data.
    1) In both BDC and BAPI which one is preferable?
    2) for suppose if it is through BDC,  how to use? what are the transactions that we can use(SHDB, ME21N,ME21)?
    3) To execute the job in background, is it possible for both call transaction and session method.
    Thanks in advance
    Sreenivas k

    It really depends on the number of records you have. Still for a set of 5,000 records my answer to your questions will be:
    1) In both BDC and BAPI which one is preferable?  - <b>Go with BDC</b>
    2) for suppose if it is through BDC, how to use? what are the transactions that we can use(SHDB, ME21N,ME21)? - <b>Yes, its SHDB for recording, SE38 for abap program and ME21 for PO. Avoid SAP Enjoy transactions for recording as you may end up having problems wiht it.</b>
    3) To execute the job in background, is it possible for both call transaction and session method. - <b>If you use call transaction method then you have to schedule the job to run in background or simply run it through F9 instead of F8. In case of session method you can chose to process the session in background. However  I would suggest you go with BDC Session method for this.</b>
    - Guru
    Reward points for helpful answers

  • Upload Purchase order text  using BDC  while updating Material Master MM02

    Hi All,
    Please help me out with sample code upload PO Txt ( long text...which is more than 72 chars)using MM02. Its very urgent
    I am not able to pass data into following fields seen in recording,
    RSTXT-TXLINE(02),
    RSTXT-TXLINE(03),
    RSTXT-TXLINE(04),
    RSTXT-TXLINE(05),  as we can see only RSTXT-TXLINE field in the RSTXT structure......
    how to split  the long text into 72 chrs each and pass into data into the RSTXT-TXLINE(02), RSTXT-TXLINE(03), RSTXT-TXLINE(04)....correspondingly........
    Thanks in advance.....
    Reagards,
    Prasad KR.

    Hi
    see the sample program
    REPORT zmm_longtext
           NO STANDARD PAGE HEADING
           LINE-SIZE 255.
    Internal Table for Upload of Long Texts Data
    DATA: BEGIN OF itab1 OCCURS 0,
            matnr    LIKE mara-matnr,    " Material
            text1    LIKE tline-tdline,  " Long Text
            text2    LIKE tline-tdline,  " Long Text
            text3    LIKE tline-tdline,  " Long Text
            text4    LIKE tline-tdline,  " Long Text
            text5    LIKE tline-tdline,  " Long Text
            text6    LIKE tline-tdline,  " Long Text
            text7    LIKE tline-tdline,  " Long Text
            text8    LIKE tline-tdline,  " Long Text
            text9    LIKE tline-tdline,  " Long Text
            text10   LIKE tline-tdline,  " Long Text
            text11   LIKE tline-tdline,  " Long Text
            text12   LIKE tline-tdline,  " Long Text
            text13   LIKE tline-tdline,  " Long Text
            text14   LIKE tline-tdline,  " Long Text
            text15   LIKE tline-tdline,  " Long Text
            text16   LIKE tline-tdline,  " Long Text
            text17   LIKE tline-tdline,  " Long Text
            text18   LIKE tline-tdline,  " Long Text
            text19   LIKE tline-tdline,  " Long Text
            text20   LIKE tline-tdline,  " Long Text
            text21   LIKE tline-tdline,  " Long Text
            text22   LIKE tline-tdline,  " Long Text
            text23   LIKE tline-tdline,  " Long Text
            text24   LIKE tline-tdline,  " Long Text
            text25   LIKE tline-tdline,  " Long Text
          END OF itab1.
    Internal Table for Upload of Long Texts Data
    DATA: BEGIN OF itab OCCURS 0,
            matnr LIKE mara-matnr,    " Material
            text  LIKE tline-tdline,  " Long Text
          END OF itab.
    To create Long Text lines for CREATE_TEXT function module
    DATA:BEGIN OF dt_lines OCCURS 0.
            INCLUDE STRUCTURE tline.   " Long Text
    DATA:END OF dt_lines.
    Variable declarations for CREATE_TEXT function module
    DATA : dl_name TYPE thead-tdname,   " Object Name
           dl_lan TYPE thead-tdspras,   " Language
           gv_matnr TYPE matnr.
    Constants
    CONSTANTS:
    Object ID for Long Text of Material Basic Data 1
      c_best     TYPE thead-tdid VALUE 'GRUN',
      c_material TYPE thead-tdobject VALUE 'MATERIAL'. " Object
    Parameters
    PARAMETERS p_file LIKE rlgrap-filename.
    At selection-screen on Value Request for file Name
    AT SELECTION-SCREEN ON VALUE-REQUEST FOR p_file.
    Get the F4 Values for the File
      CALL FUNCTION 'F4_FILENAME'
        EXPORTING
          program_name  = syst-cprog
          dynpro_number = syst-dynnr
        IMPORTING
          file_name     = p_file.
    Start Of Selection
    START-OF-SELECTION.
    *To Upload Flat file
      CALL FUNCTION 'UPLOAD'
        EXPORTING
          filename                = p_file
          filetype                = 'DAT'
        TABLES
          data_tab                = itab1
        EXCEPTIONS
          conversion_error        = 1
          invalid_table_width     = 2
          invalid_type            = 3
          no_batch                = 4
          unknown_error           = 5
          gui_refuse_filetransfer = 6
          OTHERS                  = 7.
      SORT itab1 BY matnr.
      LOOP AT itab1.
        CLEAR gv_matnr.
        SELECT SINGLE matnr INTO gv_matnr
           FROM mara WHERE bismt = itab1-matnr.
        IF itab1-text25 NE ' '.
          itab-matnr = gv_matnr.
          itab-text  = itab1-text25.
          APPEND itab.
        ENDIF.
        IF itab1-text24 NE ' '.
          itab-matnr = gv_matnr.
          itab-text  = itab1-text24.
          APPEND itab.
        ENDIF.
        IF itab1-text23 NE ' '.
          itab-matnr = gv_matnr.
          itab-text  = itab1-text23.
          APPEND itab.
        ENDIF.
        IF itab1-text22 NE ' '.
          itab-matnr = gv_matnr.
          itab-text  = itab1-text22.
          APPEND itab.
        ENDIF.
        IF itab1-text21 NE ' '.
          itab-matnr = gv_matnr.
          itab-text  = itab1-text21.
          APPEND itab.
        ENDIF.
        IF itab1-text20 NE ' '.
          itab-matnr = gv_matnr.
          itab-text  = itab1-text20.
          APPEND itab.
        ENDIF.
        IF itab1-text19 NE ' '.
          itab-matnr = gv_matnr.
          itab-text  = itab1-text19.
          APPEND itab.
        ENDIF.
        IF itab1-text18 NE ' '.
          itab-matnr = gv_matnr.
          itab-text  = itab1-text18.
          APPEND itab.
        ENDIF.
        IF itab1-text17 NE ' '.
          itab-matnr = gv_matnr.
          itab-text  = itab1-text17.
          APPEND itab.
        ENDIF.
        IF itab1-text16 NE ' '.
          itab-matnr = gv_matnr.
          itab-text  = itab1-text16.
          APPEND itab.
        ENDIF.
        IF itab1-text15 NE ' '.
          itab-matnr = gv_matnr.
          itab-text  = itab1-text15.
          APPEND itab.
        ENDIF.
        IF itab1-text14 NE ' '.
          itab-matnr = gv_matnr.
          itab-text  = itab1-text14.
          APPEND itab.
        ENDIF.
        IF itab1-text13 NE ' '.
          itab-matnr = gv_matnr.
          itab-text  = itab1-text13.
          APPEND itab.
        ENDIF.
        IF itab1-text12 NE ' '.
          itab-matnr = gv_matnr.
          itab-text  = itab1-text12.
          APPEND itab.
        ENDIF.
        IF itab1-text11 NE ' '.
          itab-matnr = gv_matnr.
          itab-text  = itab1-text11.
          APPEND itab.
        ENDIF.
        IF itab1-text10 NE ' '.
          itab-matnr = gv_matnr.
          itab-text  = itab1-text10.
          APPEND itab.
        ENDIF.
        IF itab1-text9 NE ' '.
          itab-matnr = gv_matnr.
          itab-text  = itab1-text9.
          APPEND itab.
        ENDIF.
        IF itab1-text8 NE ' '.
          itab-matnr = gv_matnr.
          itab-text  = itab1-text8.
          APPEND itab.
        ENDIF.
        IF itab1-text7 NE ' '.
          itab-matnr = gv_matnr.
          itab-text  = itab1-text7.
          APPEND itab.
        ENDIF.
        IF itab1-text6 NE ' '.
          itab-matnr = gv_matnr.
          itab-text  = itab1-text6.
          APPEND itab.
        ENDIF.
        IF itab1-text5 NE ' '.
          itab-matnr = gv_matnr.
          itab-text  = itab1-text5.
          APPEND itab.
        ENDIF.
        IF itab1-text4 NE ' '.
          itab-matnr = gv_matnr.
          itab-text  = itab1-text4.
          APPEND itab.
        ENDIF.
        IF itab1-text3 NE ' '.
          itab-matnr = gv_matnr.
          itab-text  = itab1-text3.
          APPEND itab.
        ENDIF.
           IF itab1-text2 NE ' '.
        itab-matnr = gv_matnr.
        itab-text  = itab1-text2.
        APPEND itab.
           ENDIF.
        IF itab1-text1 NE ' '.
          itab-matnr = gv_matnr.
          itab-text  = itab1-text1.
          APPEND itab.
        ENDIF.
        CLEAR itab.
      ENDLOOP.
      DELETE itab WHERE matnr EQ ' '.
    Upload the Texts
      SORT itab BY matnr.
      LOOP AT itab.
        dt_lines-tdformat = 'ST'.
        dt_lines-tdline = itab-text.
        APPEND dt_lines.
        dl_lan = sy-langu.
        dl_name = itab-matnr.
    Call the Function Module to Create Text
        CALL FUNCTION 'CREATE_TEXT'
          EXPORTING
            fid         = c_best
            flanguage   = dl_lan
            fname       = dl_name
            fobject     = c_material
            save_direct = 'X'
            fformat     = '*'
          TABLES
            flines      = dt_lines
          EXCEPTIONS
            no_init     = 1
            no_save     = 2
            OTHERS      = 3.
        IF sy-subrc <> 0.
          WRITE:/ 'Long Text Creation failed for Material'(001),
                 itab-matnr.
        ELSE.
          WRITE:/ 'Long Text Created Successfully for Material'(002),
                 itab-matnr.
        ENDIF.
        AT END OF matnr.
          REFRESH dt_lines.
        ENDAT.
      ENDLOOP.
    Reward points for useful Answers
    Regards
    Anji

  • Uploading entries into table using bdc

    hi,
    I have save the recording first in the bdc and i got the source code in program. i want to add more entries multiple into the same tabel "zmat". with different zmatcode & zmat-zdesp.
    please help me how to write the code. or what changes i have to do.
    report ZRAJESH_BDC_01
           no standard page heading line-size 255.
    include bdcrecx1.
    start-of-selection.
    perform open_group.
    perform bdc_dynpro      using 'SAPLZMAT' '0002'.
    perform bdc_field       using 'BDC_CURSOR'
                                  'ZMAT-ZMATCODE(01)'.
    perform bdc_field       using 'BDC_OKCODE'
                                  '=NEWL'.
    perform bdc_dynpro      using 'SAPLZMAT' '0003'.
    perform bdc_field       using 'BDC_CURSOR'
                                  'ZMAT-ZDESP'.
    perform bdc_field       using 'BDC_OKCODE'
                                  '=SAVE'.
    perform bdc_field       using 'ZMAT-ZMATCODE'
                                  'rajeshswami'.
    perform bdc_field       using 'ZMAT-ZDESP'
                                  'test 1001'.
    perform bdc_dynpro      using 'SAPLZMAT' '0003'.
    perform bdc_field       using 'BDC_CURSOR'
                                  'ZMAT-ZDESP'.
    perform bdc_field       using 'BDC_OKCODE'
                                  '=NEXT'.
    perform bdc_field       using 'ZMAT-ZDESP'
                                  'TEST 1001'.
    perform bdc_dynpro      using 'SAPLZMAT' '0003'.
    perform bdc_field       using 'BDC_CURSOR'
                                  'ZMAT-ZDESP'.
    perform bdc_field       using 'BDC_OKCODE'
                                  '=SAVE'.
    perform bdc_field       using 'ZMAT-ZMATCODE'
                                  'ram 0001'.
    perform bdc_field       using 'ZMAT-ZDESP'
                                  'test 0001'.
    perform bdc_dynpro      using 'SAPLZMAT' '0003'.
    perform bdc_field       using 'BDC_CURSOR'
                                  'ZMAT-ZDESP'.
    perform bdc_field       using 'BDC_OKCODE'
                                  '=UEBE'.
    perform bdc_field       using 'ZMAT-ZDESP'
                                  'TEST 0001'.
    perform bdc_dynpro      using 'SAPLZMAT' '0002'.
    perform bdc_field       using 'BDC_CURSOR'
                                  'ZMAT-ZMATCODE(02)'.
    perform bdc_field       using 'BDC_OKCODE'
                                  '=BACK'.
    perform bdc_dynpro      using 'SAPLZMAT' '0002'.
    perform bdc_field       using 'BDC_CURSOR'
                                  'ZMAT-ZMATCODE(02)'.
    perform bdc_field       using 'BDC_OKCODE'
                                  '=BACK'.
    perform bdc_transaction using 'ZMAT'.
    perform close_group.

    hi archana , first thanks for helping me.
    well this the code which i wrote.
    report ZRAJESH_07 &
           no standard page heading line-size 255. &
    PARAMETERS: zcode type ZMAT-ZMATCODE, &
                zdesp type ZMAT-ZDESP. &
    data: itab type table of zmat, &
          wa_itab like line of itab. &
    include bdcrecx1. &
    start-of-selection. &
    perform open_group. &
    perform bdc_dynpro      using 'SAPLZMAT' '0002'. &
    perform bdc_field       using 'BDC_CURSOR' &
                                  'VIM_POSITION_INFO'. &
    perform bdc_field       using 'BDC_OKCODE' &
                                  '=NEWL'. &
    perform bdc_dynpro      using 'SAPLZMAT' '0003'. &
    perform bdc_field       using 'BDC_CURSOR' &
                                  'ZMAT-ZDESP'. &
    perform bdc_field       using 'BDC_OKCODE' &
                                  '=SAVE'. &
    perform bdc_field       using 'ZMAT-ZMATCODE' &
                                  'raj1'. &
    perform bdc_field       using 'ZMAT-ZDESP' &
                                  'test raj'. &
    perform bdc_dynpro      using 'SAPLZMAT' '0003'. &
    perform bdc_field       using 'BDC_CURSOR' &
                                  'ZMAT-ZDESP'. &
    perform update_nextdata using 'zcode' 'zdesp'. &
    perform bdc_transaction using 'ZMAT1'. &
    perform close_group. &
    form update_nextdata using wa_itab-ZMATCODE wa_itab-ZMAT-ZDESP. &
      loop at itab into wa_itab. &
    perform bdc_field       using 'BDC_OKCODE' &
                                  '=NEXT'.
    *perform bdc_field       using 'ZMAT-ZDESP' &
                                 'TEST RAJ'.
    perform bdc_dynpro      using 'SAPLZMAT' '0003'. &
    perform bdc_field       using 'BDC_CURSOR' &
                                  'ZMAT-ZDESP'. &
    perform bdc_field       using 'BDC_OKCODE' &
                                  '=SAVE'. &
    perform bdc_field       using 'ZMAT-ZMATCODE' &
                                  wa_itab-ZMATCODE. &
    perform bdc_field       using 'ZMAT-ZDESP' &
                                  wa_itab-ZDESP. &
    perform bdc_dynpro      using 'SAPLZMAT' '0003'. &
    perform bdc_field       using 'BDC_CURSOR' &
                                  'ZMAT-ZDESP'. &
    perform bdc_field       using 'BDC_OKCODE' &
                                  '=ENDE'. &
    perform bdc_field       using 'ZMAT-ZDESP' &
                                  'RAJ2 TEST'. &
    endloop. &
    endform. &
    regards,
    <<Email address removed>>
    Edited by: Matt on Mar 4, 2010 3:41 PM

  • Reg Vendor master upload using BDC Call Transaction Method

    Hi All,
    Thanks in advance.
    I am uploading vendor master data using bdc call transaction method for XK01. In that  i am getting an error message that the fields " smtp_addr" ( for email) and "time_zone" (for time zone) doesnot exist on the screen '0110' ( this is the second screen) . the field timezone will be displayed on the screen only when we go for communications button and select the URL field .
    Do anybody have the solution for this problem. if possible can you give me the code for that screen.

    Create a recording via SM35 (menu go to=>recording), this will generate automatically the code for filling your bdcdata-table...

  • Create Purchase info record using LSMW idoc method

    Hello Friends,
    I am trying to update Purchase Info records using LSMW Standard program RM06IBI0.
    But it is not updating the condition price details and scale Quantity.
    For that the  form  suggessted LSMW IDOC method. with : Message Type         COND_A / COND_A02.
    But i dont know is the info record created earlier to this step or else we can create both using this method
    at a time ?  Does anybody please suggest.
    ( Actually Purchase Info record created using transaction  ME11 ).
    Regards,
    Phaneendra

    you first create the info record and subsequently you load the conditions.
    become familiar with the condition tables and its key first. Check How table A017 and A018 are maintained.
    Intresting is the field VAKEY which is actually the link to your info record.
    This is a combination of vendor, material, purchasing org, plant , and info record indicator.
    data:  begin of ZZVARKEYA,
            ZLIFNR like LFM1-LIFNR,
            ZMATNR like MARc-MATNR,
            ZEKORG like LFM1-EKORG,
            ZWERKS like MARC-WERKS,
            ZINFTYP like EINE-ESOKZ,
            end of zzvarkeyA.

  • How to record 'select' action in alv report using BDC technique

    hi guys, u r the best;)
    my question is: when u select one line in alv report, the line will be high-lighted, right? and suppose there's a button for further processing, then u can click the button to process only this line. ok now, using BDC technique, the system doesn't record the 'select' action! even i go to menu-->select all, it still doesn't work.
    or if anybody knows how to release customer expected price except t-code v.25? cuz, i'm trying to record actions in v.25.
    thx in advance, u helped me a lot.

    Hi :
       you cannot record ALV using BDC.According to ur req., after u enter data in selection screen, it goes to ALV list , there u select particular record and process further rite, say create in bck ground or foreground.
    While doing recording, in selection screen if u have any check box which displays ALV List , uncheck it and continue ur recording.
    In the bdc program u can see a field some thing like p_alvlist ' ', mark it as p_alvlist ' / '.
    If not, copy the program along with includes,  in ur  program comment all the alv part, and  call that particular FM where this selection takes place from ur main program.
    Hope this helps.
    Reward points if this is useful.
    Thx.
    Raghu

  • Automatic creation of info record

    Hi All ,
    In my case, Automatic creation of info record is active during creation of PO and in case of standard PO,  price is automatically coming during creation of PO
    But in case of consignment PO, Price is not coming automatically.
    Please help...  thanks in advance

    HI,
    In Consignment PO, Price (Condtion tab) won't be there.
    As per the concept of Consignment, stock will be in our premise but ownership of the stock will be with the vendor. Only when we consume from the consignment stock it will come under our valuation & the price maintained in the consignment info-record will used in this case.
    Refer help.sap documentation for more details on Consignment.
    Thanks & Regards,

  • Vendor info record and pricing procedure

    Hi,
          When we create PO,
    1.How the system will determine info record in that PO?
    2.What is the need and role of this info record in PO?
    3.What are the factors determines pricing procedure in PO?
       Plz send me detailed information.

    1.How the system will determine info record in that PO?
    Info record is an information record between Material & Vendor..
    the Info record will have the combination of
    Vendor, Material,Purchasing Org & Plant
    If you raise any PO basing on this combination the info record will trigger automatically
    2.What is the need and role of this info record in PO?
       The details maintained in MMD are Valuation purpose only,
      for procurement the info record is used to get the details automatically,
      Like Basic Price, Discount, Purchase Value Key,Scales etc...
    3.What are the factors determines pricing procedure in PO?
       Price determination is based on Vendor Schema & Purchase Org Schema..
       basing on the above combination Pricing procedure will be determined.
      But where to pick up the price of Pricing procedure depends upon the Access Sequence.
      In the access sequence we will define where to search first & next etc..

Maybe you are looking for