Bdc rec - reg
Hi guru's,
after i have done bdc rec, i have imported the code to my program. but i have a small problem.
1. i have selected some views for my trn mm03(during bdc rec). while executing the Final program, the view at the last is not being selected until i scroll it until that view. (but in bdc rec i hav selected them) . hope u understood.
my code snippet:
PERFORM open_group.
PERFORM bdc_dynpro USING 'SAPLMGMM' '0060'.
PERFORM bdc_field USING 'BDC_CURSOR'
'RMMG1-MATNR'.
PERFORM bdc_field USING 'BDC_OKCODE'
'=ENTR'.
PERFORM bdc_field USING 'RMMG1-MATNR'
WA_FINAL-MATNR.
PERFORM bdc_dynpro USING 'SAPLMGMM' '0070'.
PERFORM bdc_field USING 'BDC_CURSOR'
'MSICHTAUSW-DYTXT(02)'.
PERFORM bdc_field USING 'BDC_OKCODE'
'/00'.
PERFORM bdc_field USING 'MSICHTAUSW-KZSEL(01)'
c_x.
PERFORM bdc_field USING 'MSICHTAUSW-KZSEL(02)'
c_x.
PERFORM bdc_dynpro USING 'SAPLMGMM' '0070'.
PERFORM bdc_field USING 'BDC_CURSOR'
'MSICHTAUSW-DYTXT(01)'.
PERFORM bdc_field USING 'BDC_OKCODE'
'/00'.
PERFORM bdc_dynpro USING 'SAPLMGMM' '0070'.
PERFORM bdc_field USING 'BDC_CURSOR'
'MSICHTAUSW-DYTXT(01)'.
PERFORM bdc_field USING 'BDC_OKCODE'
'/00'.
PERFORM bdc_dynpro USING 'SAPLMGMM' '0070'.
PERFORM bdc_field USING 'BDC_CURSOR'
'MSICHTAUSW-DYTXT(12)'.
PERFORM bdc_field USING 'BDC_OKCODE'
'/00'.
PERFORM bdc_field USING 'MSICHTAUSW-KZSEL(12)'
c_x.
PERFORM bdc_dynpro USING 'SAPLMGMM' '0070'.
PERFORM bdc_field USING 'BDC_CURSOR'
'MSICHTAUSW-DYTXT(01)'.
PERFORM bdc_field USING 'BDC_OKCODE'
'/00'.
PERFORM bdc_dynpro USING 'SAPLMGMM' '0070'.
PERFORM bdc_field USING 'BDC_CURSOR'
'MSICHTAUSW-DYTXT(01)'.
PERFORM bdc_field USING 'BDC_OKCODE'
'/00'.
PERFORM bdc_dynpro USING 'SAPLMGMM' '0070'.
PERFORM bdc_field USING 'BDC_CURSOR'
'MSICHTAUSW-DYTXT(13)'.
PERFORM bdc_field USING 'BDC_OKCODE'
'=ENTR'.
PERFORM bdc_field USING 'MSICHTAUSW-KZSEL(13)'
c_x.
PERFORM bdc_dynpro USING 'SAPLMGMM' '0080'.
PERFORM bdc_field USING 'BDC_CURSOR'
'RMMG1-WERKS'.
PERFORM bdc_field USING 'BDC_OKCODE'
'=ENTR'.
PERFORM bdc_field USING 'RMMG1-WERKS'
plant.
PERFORM bdc_dynpro USING 'SAPLMGMM' '4004'.
PERFORM bdc_field USING 'BDC_OKCODE'
'/00'.
PERFORM bdc_field USING 'BDC_CURSOR'
'RMMG1-MATNR'.
PERFORM bdc_dynpro USING 'SAPLMGMM' '4004'.
PERFORM bdc_field USING 'BDC_OKCODE'
'/00'.
PERFORM bdc_field USING 'BDC_CURSOR'
'RMMG1-MATNR'.
PERFORM bdc_dynpro USING 'SAPLMGMM' '4000'.
PERFORM bdc_field USING 'BDC_OKCODE'
'/00'.
PERFORM bdc_field USING 'BDC_CURSOR'
'RMMG1-MATNR'.
PERFORM bdc_dynpro USING 'SAPLMGMM' '4000'.
PERFORM bdc_field USING 'BDC_OKCODE'
'/00'.
PERFORM bdc_field USING 'BDC_CURSOR'
'RMMG1-MATNR'.
PERFORM bdc_dynpro USING 'SAPLSPO1' '0300'.
PERFORM bdc_field USING 'BDC_OKCODE'
'=YES'.
PERFORM bdc_transaction USING 'MM03'.
PERFORM close_group.
So, in the above code, i want the views to be selected directly without me pressing enter. so which fiels should i change in the above code for the dynamic selection of the views in trn 'mm03'.
2. i have to skip the first two screens, like entering the materialno & selecting the views. As i have already selected them durin bdc rec.
How to code for skipping these two screens.
can anyone solve my two probs.
ask me for any clarity in my doubts.
please help me
regards,
chaitanya
Edited by: chaitanya on Mar 13, 2008 11:02 AM
hi
for ur first query :
i am giving u sample code for view selection on second screen
perform bdc_dynpro using 'SAPLMGMM' '0070'.
perform bdc_field using 'BDC_CURSOR'
'MSICHTAUSW-DYTXT(17)'.
perform bdc_field using 'BDC_OKCODE'
'P+'.perform bdc_field using 'MSICHTAUSW-KZSEL(01)'
'X'.
record-KZSEL_01_004.
perform bdc_field using 'MSICHTAUSW-KZSEL(02)'
'X'.
record-KZSEL_01_004.
perform bdc_field using 'MSICHTAUSW-KZSEL(03)'
'X'.
record-KZSEL_01_004.
perform bdc_field using 'MSICHTAUSW-KZSEL(04)'
'X'.
record-KZSEL_04_005.
perform bdc_field using 'MSICHTAUSW-KZSEL(05)'
'X'.
record-KZSEL_05_006.
perform bdc_field using 'MSICHTAUSW-KZSEL(06)'
'X'.
record-KZSEL_06_007.
perform bdc_field using 'MSICHTAUSW-KZSEL(07)'
'X'.
record-KZSEL_01_004.
*perform bdc_field using 'MSICHTAUSW-KZSEL(08)'
'X'.
record-KZSEL_01_004.
perform bdc_field using 'MSICHTAUSW-KZSEL(09)'
'X'.
record-KZSEL_09_008.
perform bdc_field using 'MSICHTAUSW-KZSEL(10)'
'X'.
record-KZSEL_01_004.
*perform bdc_field using 'MSICHTAUSW-KZSEL(11)'
'X'.
record-KZSEL_01_004.
perform bdc_field using 'MSICHTAUSW-KZSEL(12)'
'X'.
record-KZSEL_12_009.
perform bdc_field using 'MSICHTAUSW-KZSEL(13)'
'X'.
record-KZSEL_13_010.
perform bdc_field using 'MSICHTAUSW-KZSEL(14)'
'X'.
record-KZSEL_14_011.
perform bdc_field using 'MSICHTAUSW-KZSEL(15)'
'X'.
record-KZSEL_15_012.
perform bdc_field using 'MSICHTAUSW-KZSEL(16)'
'X'.
record-KZSEL_01_004.
perform bdc_field using 'MSICHTAUSW-KZSEL(17)'
'X'.
record-KZSEL_17_013.
perform bdc_dynpro using 'SAPLMGMM' '0070'.
perform bdc_field using 'BDC_CURSOR'
'MSICHTAUSW-DYTXT(01)'.
perform bdc_field using 'BDC_OKCODE'
'/00'.
perform bdc_field using 'MSICHTAUSW-KZSEL(01)'
'X'.
record-KZSEL_01_004.
perform bdc_field using 'MSICHTAUSW-KZSEL(02)'
'X'.
record-KZSEL_01_004.
perform bdc_field using 'MSICHTAUSW-KZSEL(05)'
'X'.
record-KZSEL_13_014.
perform bdc_field using 'MSICHTAUSW-KZSEL(06)'
'X'.
record-KZSEL_14_015.
perform bdc_field using 'MSICHTAUSW-KZSEL(07)'
'X'.
record-KZSEL_01_004.
perform bdc_field using 'MSICHTAUSW-KZSEL(08)'
'X'.
record-KZSEL_16_016.
perform bdc_field using 'MSICHTAUSW-KZSEL(09)'
'X'.
record-KZSEL_01_004.
here important is use P+ code to page down for select last views, and after that it may possible
that value 'MSICHTAUSW-KZSEL(07)' may be greater then 15 so change this by counting position . like
for 16 -
> 01
17 -
> 02
2. For ur second problem .
as u asking to eleminate 1and 2 screen , it is not possible bcoz
as u enter t.code first screen will come .
and without selecting VIEW u can not go further in t.code.
what u can do is make the entries in fields of these screen default then u will not requied to give them in flat file .
reward if helpful.
Similar Messages
-
please help!!
suppose the requirement is to create a bdc rec in devlopment server.
but after the rec when i try to see the source code by creating a program as the process is.it is asking me for access key.
is there any way to get the source code.
Moderator Message: Please write proper english ( "rec" in your subject line and content ), do not use shorthand abbrevations and contractions.
Message was edited by: Kesavadas ThekkillathHi,
Even If you have created the correct BDC (z) and then clicked on program tab. Then you have to write the program name in which you want to transfer the code. You program name must start with Z. Please check again.
Regards
Purnand -
hi guru's,
i have done with the bdc recording.
now to handle the enter code ( i.e.. in my actual target program while executing it, the pressing of enter in the transaction screen should not be there).
What ever the default views selected in trn mm03 should be dynamically done without user interface.. Pressing of enter should also be avoided.
here is my code snippet.
perform bdc_dynpro using 'SAPLMGMM' '0060'.
perform bdc_field using 'BDC_CURSOR'
'RMMG1-MATNR'.
perform bdc_field using 'BDC_OKCODE'
'=ENTR'.
perform bdc_field using 'RMMG1-MATNR'
wa_final-matnr.
perform bdc_dynpro using 'SAPLMGMM' '0070'.
perform bdc_field using 'BDC_CURSOR'
'MSICHTAUSW-DYTXT(02)'.
perform bdc_field using 'BDC_OKCODE'
'/00'.
perform bdc_field using 'MSICHTAUSW-KZSEL(01)'
'X'.
perform bdc_field using 'MSICHTAUSW-KZSEL(02)'
'X'.
perform bdc_dynpro using 'SAPLMGMM' '0070'.
perform bdc_field using 'BDC_CURSOR'
'MSICHTAUSW-DYTXT(01)'.
perform bdc_field using 'BDC_OKCODE'
'/00'.
perform bdc_dynpro using 'SAPLMGMM' '0070'.
perform bdc_field using 'BDC_CURSOR'
'MSICHTAUSW-DYTXT(15)'.
perform bdc_field using 'BDC_OKCODE'
'/00'.
perform bdc_field using 'MSICHTAUSW-KZSEL(15)'
'X'.
perform bdc_dynpro using 'SAPLMGMM' '0070'.
perform bdc_field using 'BDC_CURSOR'
'MSICHTAUSW-DYTXT(01)'.
perform bdc_field using 'BDC_OKCODE'
'/00'.
perform bdc_dynpro using 'SAPLMGMM' '0070'.
perform bdc_field using 'BDC_CURSOR'
'MSICHTAUSW-DYTXT(01)'.
perform bdc_field using 'BDC_OKCODE'
'/00'.
perform bdc_dynpro using 'SAPLMGMM' '0070'.
perform bdc_field using 'BDC_CURSOR'
'MSICHTAUSW-DYTXT(01)'.
perform bdc_field using 'BDC_OKCODE'
'/00'.
perform bdc_dynpro using 'SAPLMGMM' '0070'.
perform bdc_field using 'BDC_CURSOR'
'MSICHTAUSW-DYTXT(13)'.
perform bdc_field using 'BDC_OKCODE'
'/00'.
perform bdc_field using 'MSICHTAUSW-KZSEL(13)'
'X'.
perform bdc_dynpro using 'SAPLMGMM' '0070'.
perform bdc_field using 'BDC_CURSOR'
'MSICHTAUSW-DYTXT(01)'.
perform bdc_field using 'BDC_OKCODE'
'=DEF_SAVE'.
perform bdc_dynpro using 'SAPLMGMM' '0070'.
perform bdc_field using 'BDC_CURSOR'
'USRM1-AAUSW'.
perform bdc_field using 'BDC_OKCODE'
'=DEF_SKIP'.
perform bdc_field using 'USRM1-AAUSW'
'X'.
perform bdc_dynpro using 'SAPLMGMM' '0070'.
perform bdc_field using 'BDC_CURSOR'
'MSICHTAUSW-DYTXT(01)'.
perform bdc_field using 'BDC_OKCODE'
'=ENTR'.
perform bdc_field using 'USRM1-AAUSW'
'X'.
perform bdc_dynpro using 'SAPLMGMM' '0080'.
perform bdc_field using 'BDC_CURSOR'
'RMMG1-WERKS'.
perform bdc_field using 'BDC_OKCODE'
'=DEF_SAVE'.
perform bdc_field using 'RMMG1-WERKS'
plant.
perform bdc_dynpro using 'SAPLMGMM' '0080'.
perform bdc_field using 'BDC_CURSOR'
'RMMG1-WERKS'.
perform bdc_field using 'BDC_OKCODE'
'=ENTR'.
perform bdc_field using 'RMMG1-WERKS'
'Z201'.
perform bdc_dynpro using 'SAPLMGMM' '4004'.
perform bdc_field using 'BDC_OKCODE'
'/00'.
perform bdc_field using 'BDC_CURSOR'
'RMMG1-MATNR'.
perform bdc_dynpro using 'SAPLMGMM' '4004'.
perform bdc_field using 'BDC_OKCODE'
'/00'.
perform bdc_field using 'BDC_CURSOR'
'RMMG1-MATNR'.
perform bdc_dynpro using 'SAPLMGMM' '4000'.
perform bdc_field using 'BDC_OKCODE'
'/00'.
perform bdc_field using 'BDC_CURSOR'
'RMMG1-MATNR'.
perform bdc_dynpro using 'SAPLMGMM' '4000'.
perform bdc_field using 'BDC_OKCODE'
'/00'.
perform bdc_field using 'BDC_CURSOR'
'RMMG1-MATNR'.
perform bdc_dynpro using 'SAPLSPO1' '0300'.
perform bdc_field using 'BDC_OKCODE'
'=YES'.
perform bdc_transaction using 'MM03'.
please help me.
*HOW TO HANDLE THE ENTER CODE.
WHAT CHANGES SHOULD I MAKE IN THE ABOVE CODE AND WHAT ARE THE CORRESPONDING DATA DECLARATIONS TO BE MADE.*See The sample code
It consist of Item data and Header data .
REPORT zfv11
NO STANDARD PAGE HEADING LINE-SIZE 255.
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 ***
TABLES : t100.
DATA: BEGIN OF record OCCURS 0,
data element: KSCHA
kschl(004), "Condition Type
data element: SELKZ_LIST
selkz(001),
data element: WERKS_D
werks(004), "Plant
data element: ELIFN
lifnr(010), "Vendor
data element: MATNR
matnr(018), "Material No.
data element: KBETR_KOND
kbetr(016), "Amount
data element: KODATAB
datab(010), "Condition Validity Date from
data element: KODATBI
datbi(010), "Condition Validity To
data element: MWSKZ
mwsk1(002),
END OF record.
DATA : BEGIN OF it_new OCCURS 0, " Internal Table for Header Data
kschl(004),
werks(004),
lifnr(010),
END OF it_new.
DATA : BEGIN OF it_item OCCURS 0, " Internal table for Item Data
werks(004),
lifnr(010),
matnr(018),
kbetr(016),
datab(010),
datbi(010),
mwsk1(002),
END OF it_item.
DATA : cnt(2) TYPE n,
fld(25) TYPE c.
TYPE-POOLS: truxs.
DATA: it_raw TYPE truxs_t_text_data.
DATA : n TYPE n.
DATA:
BEGIN OF t_data OCCURS 0,
data TYPE string,
END OF t_data.
DATA:BEGIN OF it_mess OCCURS 0,
msgtyp(5),
lms(200),
msgv1(50),
END OF it_mess.
DATA : p_mode TYPE c.
DATA:it_msgtab TYPE STANDARD TABLE OF bdcmsgcoll WITH HEADER LINE,
it_msgtab1 TYPE STANDARD TABLE OF bdcmsgcoll WITH HEADER LINE.
DATA : l_mstring(150).
DATA : BEGIN OF bdcdata OCCURS 0.
INCLUDE STRUCTURE bdcdata.
DATA: END OF bdcdata.
PARAMETERS : p_file1 LIKE rlgrap-filename.
INITIALIZATION.
AT SELECTION-SCREEN ON VALUE-REQUEST FOR p_file1.
PERFORM file_selection.
PERFORM data_upload.
PERFORM table_control.
LOOP AT it_new.
REFRESH bdcdata.
PERFORM bdc_dynpro USING 'SAPMV13A' '0100'.
PERFORM bdc_field USING 'BDC_CURSOR'
'RV13A-KSCHL'.
PERFORM bdc_field USING 'BDC_OKCODE'
'/00'.
PERFORM bdc_field USING 'RV13A-KSCHL'
it_new-kschl.
PERFORM bdc_dynpro USING 'SAPLV14A' '0100'.
PERFORM bdc_field USING 'BDC_CURSOR'
'RV130-SELKZ(01)'.
PERFORM bdc_field USING 'BDC_OKCODE'
'=WEIT'.
PERFORM bdc_dynpro USING 'SAPMV13A' '1363'.
PERFORM bdc_field USING 'BDC_CURSOR'
'KONP-KBETR(01)'.
PERFORM bdc_field USING 'BDC_OKCODE'
'/00'.
PERFORM bdc_field USING 'KOMG-WERKS'
it_new-werks.
PERFORM bdc_field USING 'KOMG-LIFNR'
it_new-lifnr.
DATA: "X(5) TYPE N,
N(5) TYPE N.
N = 0.
LOOP AT it_item.
N = N + 1.
ENDLOOP.
"X = 1.
CNT = 1.
DO N TIMES.
IF CNT > 19.
perform bdc_field using 'BDC_OKCODE' 'KOMG-MATNR(01)'.
perform bdc_field using 'BDC_OKCODE' '=P+'.
PERFORM bdc_dynpro USING 'SAPMV13A' '1363'.
CNT = 1.
ENDIF.
cnt = 1.
LOOP AT it_item WHERE werks EQ it_new-werks AND lifnr EQ it_new-lifnr . "FROM x TO x.
CONCATENATE 'KOMG-MATNR(' cnt ')' INTO fld.
PERFORM bdc_field USING fld it_item-matnr.
CONCATENATE 'KONP-KBETR(' cnt')' INTO fld.
PERFORM bdc_field USING fld it_item-kbetr.
CONCATENATE 'RV13A-DATAB(' cnt ')' INTO fld.
PERFORM bdc_field USING fld it_item-datab.
CONCATENATE 'RV13A-DATBI(' cnt ')' INTO fld.
PERFORM bdc_field USING fld it_item-datbi.
CONCATENATE 'KONP-MWSK1(' cnt ')' INTO fld.
PERFORM bdc_field USING fld it_item-mwsk1.
cnt = cnt + 1.
if cnt = 20.
perform bdc_field using 'BDC_OKCODE' 'KOMG-MATNR(19)'.
perform bdc_field using 'BDC_OKCODE' '=P+'.
PERFORM bdc_dynpro USING 'SAPMV13A' '1363'.
CNT = 1.
endif.
CLEAR it_item.
ENDLOOP.
ENDDO.
PERFORM bdc_dynpro USING 'SAPMV13A' '1363'.
PERFORM bdc_field USING 'BDC_CURSOR'
'KONP-MWSK1(01)'.
PERFORM bdc_field USING 'BDC_OKCODE'
'=SICH'.
CALL TRANSACTION 'FV11' USING bdcdata MODE 'A'
UPDATE 'S'
MESSAGES INTO it_msgtab.
CLEAR bdcdata[].
PERFORM error.
ENDLOOP.
Start new screen -Subroutine for screen s *
FORM bdc_dynpro USING program dynpro.
CLEAR bdcdata.
bdcdata-program = program.
bdcdata-dynpro = dynpro.
bdcdata-dynbegin = 'X'.
APPEND bdcdata.
ENDFORM. "BDC_DYNPRO
Insert field -Subroutine for field s *
FORM bdc_field USING fnam fval.
CLEAR bdcdata.
bdcdata-fnam = fnam.
bdcdata-fval = fval.
APPEND bdcdata.
ENDFORM. "BDC_FIELD
*& Form file_selection
FORM file_selection .
CALL FUNCTION 'F4_FILENAME'
EXPORTING
program_name = syst-cprog
dynpro_number = syst-dynnr
field_name = 'P_FILE1'
IMPORTING
file_name = p_file1.
ENDFORM. " file_selection
*& Form data_upload
FORM data_upload .
CALL FUNCTION 'TEXT_CONVERT_XLS_TO_SAP'
EXPORTING
I_FIELD_SEPERATOR =
i_line_header = 'X'
i_tab_raw_data = it_raw
i_filename = p_file1
TABLES
i_tab_converted_data = record
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. " data_upload
*& Form error
FORM error .
LOOP AT it_msgtab.
IF it_msgtab-msgtyp = 'E'.
SELECT SINGLE * FROM t100 WHERE sprsl = it_msgtab-msgspra
AND arbgb = it_msgtab-msgid
AND msgnr = it_msgtab-msgnr.
IF sy-subrc = 0.
l_mstring = t100-text.
IF l_mstring CS '&1'.
REPLACE '&1' WITH it_msgtab-msgv1 INTO l_mstring.
REPLACE '&2' WITH it_msgtab-msgv2 INTO l_mstring.
REPLACE '&3' WITH it_msgtab-msgv3 INTO l_mstring.
REPLACE '&4' WITH it_msgtab-msgv4 INTO l_mstring.
ELSE.
REPLACE '&' WITH it_msgtab-msgv1 INTO l_mstring.
REPLACE '&' WITH it_msgtab-msgv2 INTO l_mstring.
REPLACE '&' WITH it_msgtab-msgv3 INTO l_mstring.
REPLACE '&' WITH it_msgtab-msgv4 INTO l_mstring.
ENDIF.
CONDENSE l_mstring.
it_mess-msgtyp = it_msgtab-msgtyp.
it_mess-lms = l_mstring.
it_mess-msgv1 = it_msgtab-msgv1.
APPEND it_mess.
WRITE: / it_msgtab-msgtyp, l_mstring(150).
ELSE.
WRITE: / it_msgtab.
it_mess-msgtyp = it_msgtab-msgtyp.
it_mess-lms = l_mstring.
it_mess-msgv1 = it_msgtab-msgv1.
APPEND it_mess.
ENDIF.
ENDIF.
ENDLOOP.
ENDFORM. " error
*& Form table_Control
FORM table_control .
SORT record BY lifnr matnr.
LOOP AT record.
ON CHANGE OF record-lifnr.
MOVE-CORRESPONDING record TO it_new.
APPEND it_new.
ENDON.
MOVE-CORRESPONDING record TO it_item.
APPEND it_item.
ENDLOOP.
ENDFORM. " table_Control
Reward if helpful
Thanks
Jagadeesh.G -
About bdc rec & usage in target prog
hi guru's,
after the bdc recording is done, ihave got it in to a new program. can u give how to proceed further.
where to insert the forms & code of this bdc_rec in my target program.
please, can u give me a step wise like u did earlier for recording.
i would be thankful to u for this detailed help.
regards,
chaituHi,
You can see that there are two types of performs in the BDC recorded program
Perform for screen, Perform for fields and Perform for transaction.
After the recorded program is created.
1. copy all performs into new program.
2. write the FORM...ENDFORM for the given performs (as given at end of sample program below).
3. Now for those fields where you have entered the values at the time of recording, replace the screen fields in the perform by values which you want to pass.
Eg: PERFORM bdc_field USING 'RL02B-MBLNR'
gt_headret-mat_doc.
Above step indicates that material document number from internal table gt_headret is passed to screen field 'RL02B-MBLNR'.
similarly replace all the other fields accept those which capture the events like 'enter pressed'.
Refer below program:
REFRESH itab_bdcdata.
PERFORM bdc_dynpro USING 'SAPML02B' '0203'.
PERFORM bdc_field USING 'BDC_CURSOR'
'RL02B-LGNUM'.
PERFORM bdc_field USING 'BDC_OKCODE'
'/00'.
PERFORM bdc_field USING 'RL02B-MBLNR'
gt_headret-mat_doc.
PERFORM bdc_field USING 'RL02B-MJAHR'
gt_headret-doc_year.
PERFORM bdc_field USING 'RL02B-LGNUM'
wa_mseg-lgnum.
PERFORM bdc_field USING 'RL02B-DUNKL'
'H'.
PERFORM bdc_dynpro USING 'SAPML03T' '0132'.
PERFORM bdc_field USING 'BDC_OKCODE'
'=TPAL'.
PERFORM bdc_field USING 'BDC_CURSOR'
'LTBP1-OFMEA(01)'.
PERFORM bdc_dynpro USING 'SAPML03T' '0104'.
PERFORM bdc_field USING 'BDC_CURSOR'
'RL03T-ANZL1'.
PERFORM bdc_field USING 'BDC_OKCODE'
'=TAH1'.
PERFORM bdc_field USING 'LTAP-WDATU'
lv_date.
PERFORM bdc_field USING 'RL03T-LMEN1'
lv_lhmg1.
PERFORM bdc_field USING 'RL03T-LETY1'
'IP'.
PERFORM bdc_field USING 'RL03T-ANZL2'
'1'.
PERFORM bdc_field USING 'RL03T-LMEN2'
wa_mseg-menge.
PERFORM bdc_field USING 'RL03T-LETY2'
'IP'.
PERFORM bdc_dynpro USING 'SAPML03T' '0102'.
PERFORM bdc_field USING 'BDC_CURSOR'
'LTAP-NLENR'.
PERFORM bdc_field USING 'BDC_OKCODE'
'/00'.
PERFORM bdc_field USING 'LTAP-LETYP'
'IP'.
PERFORM bdc_field USING 'LTAP-WDATU'
lv_date.
PERFORM bdc_field USING 'LTAP-NLTYP'
v_stotyp.
PERFORM bdc_field USING 'LTAP-NLPLA'
wa_mlgt-lgpla.
PERFORM bdc_field USING 'LTAP-NLENR'
it_ft_mb31-lenum.
PERFORM bdc_dynpro USING 'SAPML03T' '0104'.
PERFORM bdc_field USING 'BDC_CURSOR'
'RL03T-ANZL1'.
PERFORM bdc_field USING 'BDC_OKCODE'
'=BU'.
PERFORM bdc_field USING 'LTAP-WDATU'
lv_date.
PERFORM bdc_field USING 'RL03T-LMEN1'
lv_lhmg1.
PERFORM bdc_field USING 'RL03T-LETY1'
'IP'.
PERFORM bdc_field USING 'RL03T-LMEN2'
wa_mseg-menge.
PERFORM bdc_field USING 'RL03T-LETY2'
'IP'.
*& Form bdc_dynpro
text
FORM bdc_dynpro USING program dynpro.
itab_bdcdata-program = program.
itab_bdcdata-dynpro = dynpro.
itab_bdcdata-dynbegin = 'X'.
APPEND itab_bdcdata.
CLEAR itab_bdcdata.
ENDFORM. " bdc_dynpro
*& Form bdc_field
text
FORM bdc_field USING fnam fval.
itab_bdcdata-fnam = fnam.
itab_bdcdata-fval = fval.
CONDENSE itab_bdcdata-fval.
APPEND itab_bdcdata.
CLEAR itab_bdcdata.
ENDFORM. " bdc_field
& Form bdc_transaction
FORM bdc_transaction USING tcode.
CALL TRANSACTION tcode USING bdcdata
MODE 'A'
UPDATE 'S'.
ENDFORM. " bdc_transaction -
Dear gurus,
I want run a bdc for transaction mm02.
i want to update 20 record from the xl file.
If 10th record getting problem, what will happen if i use session method ?
what will happen if i use call transanction method?
how to find the error in the both methods?
kindly let me know.
thanks in advance
R.RajendranOnly the 10th record gets failed in both session and call transaction method.
The rest gets updated just fine.
In BDC Session methiod, you can get the error log in the SM35 transaction.
IN case of call transaction, you have to handle the errors yourself like this
call transaction '<TCODE>' using it_bdcdata messages into it_bdcmsgcoll options from x_CTUPARAMS.
if sy-subrc <> 0.
loop at it_bdcmsgcoll.
call function 'FORMAT_MESSAGE'
exporting
message = v_message.
write:/ v_message.
endloop.
endif. -
E-Rec Reg Letter section in Correspondance of activity mgmt compone
Hi Experts,
I have an issue in the view 'V_CORRESPOND' of the component 'ERC_C_ACTIVITY_MGMT_UI'.While clicking the changable letter section link in the component, a formatted text edit will be displayed.There we will enter the text and then click on preview link means, smartform will be displayed.But what the problem is,when displaying the formatted text edit on click of changable letter section link ,some unrecognized text (Some text is displaying in chinese letter) is dispalyed and also i couldnt able to edit the text edit field.I have checked via debugging the component,there is no text in the formatted text edit but it is displaying in the output.Could you please help me to sort it out this issue ?
Thanks & Regards,
R.Dhineshraj.Dear Govindu,
Please review notes containing info on this offer :
1073200 Global variables,formatting in individualized correspondence
1080924 Customer variables not reflected in letter section
Best Regards,
Deepak.. -
Hi ,
I am trying to create a BDC for routing opertaions update . During recording for a Screen ( that has subscreens )i get this :
BDC_SUBSCR SAPLCPDO 1210GENERAL.
I wanted to know Is there a special way to populate the subscreen fields ? I just copied the bdcdata-fnam = 'bdc_subscr' and fval = SAPLCPDO 1210GENERAL , but it looks like this is not the correct way as i get an error saying No transaction data for screen SAPLCPDO.
I would appreciate if anyone can let me know how to code for this.
Thank you very muchTamanna,
If your requirement is how to code BDC program for a transaction which has subscreens in it...then refer to the example program I had created at one of my client places. But this is not for tcode CA02. Sorry I couldn't be of more help.
* Table declaration
TABLES:
wyt3,
/bay2/u7sxcrecce.
*& Internal Table Declaration for Bushy Park Legacy data
DATA : BEGIN OF i_leg OCCURS 0,
po_nm(15), " PO No - EBELN
byrc(2), " Purchasing group - buyer code - EKGRP
vendor(10), " LIFNR
po_date(6), " BEDAT
cur(3), " currency - WAERS
zterm(2), " terms code - ZTERM
fob(2), " FOB code - IINCO1
mat(7), " material - EMATN
mat_pck(15), " material PCK - ematn
quant(15), " quantity due - MENGE
u_meas(2), " Unit of measure - MEINS
del_date(6), " Item delivery date - EINDT
ven_mat(30), " Material # used by vendor
net_pr(17), " Net price - NETPR
ship_via(3), " Ship via
del_loc(5), " Delivery location - ABLAD
dist_acc(21), " Distribution account
txz01(55), " Purchase Document Text
recip(5), " Recipient - WEMPF
line_cd(3), " Line code
comp(2), " Company
line_num(4), " PO line number
indicator(1), " Indictor as to what kind of PO's is being converted
projnbr(30), " filler
works(2), " Legacy works - WERKS
work_ord(7), " Work Order Number - AUFNR
wbs(8), " Project number - use for WBS x-ref
cost_elem(7), " G/L account for Project PO's w/o mat. master - SAKTO
xref_wbs(23), " WBS for manual load - SAKTO
percent(12), " Mara
* Filler for NET PRICE
filler(17), " Mara - net price
gl_act(7), " GL acct for Work Order
label(3), " Label
iwg_warehouse(9),
cost_cen(5), " Cost center
expence_cl(4), " Expence class
tax_code(2), " Tax Code
quan_gr(16), " Quantity of goods received
amt_gr(17), " Amount of goods received
quan_fi(16), " Quantity invoiced
amt_fi(17), " Amount invoiced
site(15), " Site name - Added by Naren Somen
* flag(1), " Indicator for valuted material - N/A
* commit_amt(14)," Commitment value
END OF i_leg.
*& Internal Table Declaration for SAP data
DATA : BEGIN OF i_sap OCCURS 0,
po_nm(15), " PO No - EBELN
ekgrp(3), " Purchasing Group
lifnr(10), " Vendor Number
zterm(4), " Payment Terms
werks(4), " Plant
txz01(40), " Text
netprice(14), " Price
commit_amt(14), " Commitment values
END OF i_sap.
DATA: bdcdata LIKE bdcdata OCCURS 0 WITH HEADER LINE.
DATA: i_xleg LIKE i_leg OCCURS 0 WITH HEADER LINE.
DATA: i_wyt3 LIKE wyt3 OCCURS 0 WITH HEADER LINE.
DATA: p_itab LIKE i_leg OCCURS 0 WITH HEADER LINE.
* Internal table to store the messages
DATA: BEGIN OF i_mesage_tab OCCURS 0.
INCLUDE STRUCTURE bdcmsgcoll .
DATA END OF i_mesage_tab.
*Begin of change by Naren Somen
*Buffer to the hold the records from tab delimited text file
DATA: BEGIN OF i_record_buffer,
record_buffer(4000) TYPE c.
DATA: END OF i_record_buffer.
*End of change by Naren Somen
DATA: w_input_rec_count(6) TYPE n," Input File Record Counter
w_address TYPE p, " Count of vendor addresses found
w_flg TYPE c VALUE 'X', " BDC Rec Indicator
w_insert_line(1) TYPE c, " Insert New Line Item in PO
w_del_date(10), " Delivery Date Format Changes
w_year(4), " Year
w_mon(2), " Month
w_date(2), " Date
w_purgrp(3), " SAP Purchasing group
w_vendor(10), " SAP vendor
w_payterm(4), " SAP payment terms
w_plant(4), " SAP plant
w_acct(10), " SAP G/L acct - temp
w_order(12), " SAP Work Order Number
w_aufnr LIKE ekkn-aufnr. " Work Order
DATA: w_input LIKE swaexpdef-expr,
w1_dec LIKE dfies-decimals,
w_mul TYPE i,
w_val TYPE i,
w_val01 LIKE ekpo-netpr,
w_netprice(11), " Net Price
w_netprice_hold(11), " hold variable for net price
w_netprice1(14), " Net Price before dec. point
w_netprice2(9), " Net Price after dec. point
w_quant TYPE c VALUE '1', " Quantity
w_count LIKE sy-tabix, " Loop Counter
w_costcenter TYPE kostl, " Costcenter
w_glaccount TYPE kstar, " G/L account
w_item TYPE bstpo VALUE '0010', " Line item number
w_quote(1) TYPE x VALUE '27'.
DATA: BEGIN OF i_epstp,
field1(11) TYPE c VALUE 'RM06E-EPSTP',
field2(1) TYPE c VALUE '(',
field3(3) TYPE n VALUE 000,
field4(1) TYPE c VALUE ')',
END OF i_epstp.
DATA: BEGIN OF i_knttp,
field1(10) TYPE c VALUE 'EKPO-KNTTP',
field2(1) TYPE c VALUE '(',
field3(3) TYPE n VALUE 000,
field4(1) TYPE c VALUE ')',
END OF i_knttp.
DATA: BEGIN OF i_txz01,
field1(10) TYPE c VALUE 'EKPO-TXZ01',
field2(1) TYPE c VALUE '(',
field3(3) TYPE n VALUE 000,
field4(1) TYPE c VALUE ')',
END OF i_txz01.
DATA: BEGIN OF i_eeind,
field1(11) TYPE c VALUE 'RM06E-EEIND',
field2(1) TYPE c VALUE '(',
field3(3) TYPE n VALUE 000,
field4(1) TYPE c VALUE ')',
END OF i_eeind.
DATA: BEGIN OF i_netpr,
field1(10) TYPE c VALUE 'EKPO-NETPR',
field2(1) TYPE c VALUE '(',
field3(3) TYPE n VALUE 000,
field4(1) TYPE c VALUE ')',
END OF i_netpr.
DATA: BEGIN OF i_matkl,
field1(10) TYPE c VALUE 'EKPO-MATKL',
field2(1) TYPE c VALUE '(',
field3(3) TYPE n VALUE 000,
field4(1) TYPE c VALUE ')',
END OF i_matkl.
DATA: BEGIN OF i_werks,
field1(10) TYPE c VALUE 'EKPO-WERKS',
field2(1) TYPE c VALUE '(',
field3(3) TYPE n VALUE 000,
field4(1) TYPE c VALUE ')',
END OF i_werks.
DATA: BEGIN OF i_ktext1,
field1(11) TYPE c VALUE 'ESLL-KTEXT1',
field2(1) TYPE c VALUE '(',
field3(3) TYPE n VALUE 000,
field4(1) TYPE c VALUE ')',
END OF i_ktext1.
DATA: BEGIN OF i_meins,
field1(10) TYPE c VALUE 'ESLL-MEINS',
field2(1) TYPE c VALUE '(',
field3(3) TYPE n VALUE 000,
field4(1) TYPE c VALUE ')',
END OF i_meins.
DATA: BEGIN OF i_ekpo_meins,
field1(10) TYPE c VALUE 'EKPO-MEINS',
field2(1) TYPE c VALUE '(',
field3(3) TYPE n VALUE 000,
field4(1) TYPE c VALUE ')',
END OF i_ekpo_meins.
DATA: BEGIN OF i_menge,
field1(10) TYPE c VALUE 'ESLL-MENGE',
field2(1) TYPE c VALUE '(',
field3(3) TYPE n VALUE 000,
field4(1) TYPE c VALUE ')',
END OF i_menge.
DATA: BEGIN OF i_ekpo_menge,
field1(10) TYPE c VALUE 'EKPO-MENGE',
field2(1) TYPE c VALUE '(',
field3(3) TYPE n VALUE 000,
field4(1) TYPE c VALUE ')',
END OF i_ekpo_menge.
DATA: BEGIN OF i_tbtwr,
field1(10) TYPE c VALUE 'ESLL-TBTWR',
field2(1) TYPE c VALUE '(',
field3(3) TYPE n VALUE 000,
field4(1) TYPE c VALUE ')',
END OF i_tbtwr.
DATA: BEGIN OF i_mkntm,
field1(11) TYPE c VALUE 'RM11K-MKNTM',
field2(1) TYPE c VALUE '(',
field3(3) TYPE n VALUE 000,
field4(1) TYPE c VALUE ')',
END OF i_mkntm.
DATA: BEGIN OF i_kostl,
field1(10) TYPE c VALUE 'ESKN-KOSTL',
field2(1) TYPE c VALUE '(',
field3(3) TYPE n VALUE 000,
field4(1) TYPE c VALUE ')',
END OF i_kostl.
DATA: BEGIN OF i_sakto,
field1(10) TYPE c VALUE 'ESKN-SAKTO',
field2(1) TYPE c VALUE '(',
field3(3) TYPE n VALUE 000,
field4(1) TYPE c VALUE ')',
END OF i_sakto.
DATA: BEGIN OF i_bstpo,
field1(11) TYPE c VALUE 'RM06E-BSTPO',
field2(1) TYPE c VALUE '(',
field3(3) TYPE n VALUE 000,
field4(1) TYPE c VALUE ')',
END OF i_bstpo.
DATA: BEGIN OF i_kstar,
kstar TYPE kstar,
END OF i_kstar.
DATA: c_yb(2) VALUE 'YB'.
DATA: c_partner_counter(3) TYPE c VALUE '002'. "Partner Counter -
"Naren Somen
CONSTANTS: c_185(4) TYPE c VALUE '0185', " System ID - Walker
c_202(4) TYPE c VALUE '0202', " System ID - Bushy Park
c_delimiter(1) TYPE x VALUE '09'," tab character-Naren Somen
c_unit(2) TYPE c VALUE 'PU', " Unit of measure
c_sq(2) TYPE c VALUE 'SQ',
c_zero(1) TYPE c VALUE '0',
c_loop(2) TYPE c VALUE '14',
c_00(2) TYPE c VALUE '00'.
*& Input Parameters / Selection Options
SELECTION-SCREEN BEGIN OF BLOCK bl1 WITH FRAME TITLE text-tx1.
PARAMETERS : p_input LIKE filename-fileextern OBLIGATORY, " Input File
p_error LIKE filename-fileextern OBLIGATORY. " Output File
SELECTION-SCREEN END OF BLOCK bl1.
SELECTION-SCREEN BEGIN OF BLOCK bl3 WITH FRAME TITLE text-tx3.
PARAMETERS : p_ekorg LIKE ekko-ekorg OBLIGATORY.
SELECTION-SCREEN END OF BLOCK bl3.
SELECTION-SCREEN BEGIN OF BLOCK bl4 WITH FRAME TITLE text-tx4.
PARAMETERS : p_uname LIKE apqi-userid OBLIGATORY,
p_sess LIKE bgr00-group OBLIGATORY.
SELECTION-SCREEN END OF BLOCK bl4.
*& Main Program Logic
START-OF-SELECTION.
PERFORM open_input_output_files.
PERFORM create_bdc_session.
PERFORM write_results.
END-OF-SELECTION.
*& Form OPEN_INPUT_OUTPUT_FILES
FORM open_input_output_files.
PERFORM open_input_file.
PERFORM open_output_error_file.
ENDFORM. " OPEN_INPUT_OUTPUT_FILES
*& Form CREATE_BDC_SESSION
FORM create_bdc_session.
PERFORM open_group.
i_xleg[] = i_leg[].
LOOP AT i_leg.
IF i_leg-po_nm = i_xleg-po_nm.
SKIP.
ELSE.
PERFORM read_xref_tables.
*-- First screen
CLEAR w_insert_line.
PERFORM bdc_dynpro USING 'SAPMM06E' '0100'.
PERFORM bdc_field USING 'BDC_CURSOR' 'RM06E-BSART'.
PERFORM bdc_field USING 'BDC_OKCODE' '/00'.
PERFORM bdc_field USING 'EKKO-LIFNR' i_sap-lifnr.
PERFORM bdc_field USING 'RM06E-BSART' c_yb.
PERFORM bdc_field USING 'EKKO-EKORG' p_ekorg.
PERFORM bdc_field USING 'EKKO-EKGRP' i_sap-ekgrp.
PERFORM vendor_address.
IF w_address EQ '3'.
PERFORM bdc_dynpro USING 'SAPMSSY0' '0120'.
PERFORM bdc_field USING 'BDC_CURSOR' '04/02'.
PERFORM bdc_field USING 'BDC_OKCODE' '=SELV'.
PERFORM bdc_dynpro USING 'SAPMSSY0' '0120'.
PERFORM bdc_field USING 'BDC_CURSOR' '04/02'.
PERFORM bdc_field USING 'BDC_OKCODE' '=SELV'.
PERFORM bdc_dynpro USING 'SAPMSSY0' '0120'.
PERFORM bdc_field USING 'BDC_CURSOR' '04/02'.
PERFORM bdc_field USING 'BDC_OKCODE' '=SELV'.
ENDIF.
IF w_address EQ '2'.
PERFORM bdc_dynpro USING 'SAPMSSY0' '0120'.
PERFORM bdc_field USING 'BDC_CURSOR' '04/02'.
PERFORM bdc_field USING 'BDC_OKCODE' '=SELV'.
PERFORM bdc_dynpro USING 'SAPMSSY0' '0120'.
PERFORM bdc_field USING 'BDC_CURSOR' '04/02'.
PERFORM bdc_field USING 'BDC_OKCODE' '=SELV'.
ENDIF.
IF w_address EQ '1'.
PERFORM bdc_dynpro USING 'SAPMSSY0' '0120'.
PERFORM bdc_field USING 'BDC_CURSOR' '04/02'.
PERFORM bdc_field USING 'BDC_OKCODE' '=SELV'.
ENDIF.
PERFORM bdc_dynpro USING 'SAPMM06E' '0120'.
PERFORM bdc_field USING 'BDC_CURSOR' 'RM06E-EBELP'.
PERFORM bdc_field USING 'BDC_OKCODE' '=KOPF'.
PERFORM bdc_dynpro USING 'SAPMM06E' '0101'.
PERFORM bdc_field USING 'BDC_CURSOR' 'EKKO-VERKF'.
PERFORM bdc_field USING 'BDC_OKCODE' 'AB'.
PERFORM bdc_field USING 'EKKO-VERKF' i_leg-po_nm.
PERFORM bdc_field USING 'EKKO-ZTERM' i_sap-zterm.
PERFORM bdc_field USING 'EKKO-SPRAS' 'EN'.
PERFORM bdc_field USING 'BDC_SUBSCR' 'SAPLXM06'.
PERFORM record_counter.
LOOP AT i_xleg WHERE po_nm EQ i_leg-po_nm.
* w_count = w_count + 1.
WRITE: i_leg-del_date TO w_del_date YYMMDD.
CONCATENATE '20' w_del_date INTO w_del_date.
MOVE w_del_date(4) TO w_year.
MOVE w_del_date+4(2) TO w_date.
MOVE w_del_date+6(2) TO w_mon.
CONCATENATE w_date '/' w_mon '/' w_year INTO w_del_date.
PERFORM item_xref_tables.
IF w_insert_line EQ space.
*-- Second Screen Line # 1
PERFORM bdc_dynpro USING 'SAPMM06E' '0120'.
PERFORM bdc_field USING 'BDC_CURSOR' i_eeind.
PERFORM bdc_field USING 'BDC_OKCODE' '/00'.
* PERFORM bdc_field USING i_bstpo w_item.
PERFORM bdc_field USING i_epstp 'D'.
PERFORM bdc_field USING i_knttp 'K'.
PERFORM bdc_field USING i_txz01 i_sap-txz01.
PERFORM bdc_field USING i_eeind w_del_date.
PERFORM bdc_field USING i_netpr i_sap-netprice.
PERFORM bdc_field USING i_matkl '25080400'.
PERFORM bdc_field USING i_werks i_sap-werks.
**-- Second Screen Line # 2 Onwards.
ELSE.
*--- Call Insert Line.
PERFORM line_item_data.
IF i_epstp-field3 GT c_loop.
PERFORM bdc_dynpro USING 'SAPMM06E' '0120'.
PERFORM bdc_field USING 'BDC_CURSOR' 'RM06E-EBELP'.
PERFORM bdc_field USING 'BDC_OKCODE' '=NP'.
PERFORM record_counter.
PERFORM line_item_data.
ENDIF.
PERFORM bdc_dynpro USING 'SAPMM06E' '0120'.
PERFORM bdc_field USING 'BDC_CURSOR' i_eeind.
PERFORM bdc_field USING 'BDC_OKCODE' '/00'.
* PERFORM bdc_field USING i_bstpo w_item.
PERFORM bdc_field USING i_epstp 'D'.
PERFORM bdc_field USING i_knttp 'K'.
PERFORM bdc_field USING i_txz01 i_sap-txz01.
PERFORM bdc_field USING i_eeind w_del_date.
PERFORM bdc_field USING i_netpr i_sap-netprice.
PERFORM bdc_field USING i_matkl '25080400'.
PERFORM bdc_field USING i_werks i_sap-werks.
ENDIF.
w_insert_line = 'X'.
*-- Third Screen.
PERFORM bdc_dynpro USING 'SAPLMLSP' '0200'.
PERFORM bdc_field USING 'BDC_OKCODE' '/00'.
PERFORM bdc_field USING 'BDC_SUBSCR' 'SAPLMLSP'.
PERFORM bdc_field USING 'BDC_SUBSCR' 'SAPLMLSL'.
PERFORM bdc_field USING 'BDC_SUBSCR' 'SAPLMLSL'.
PERFORM bdc_field USING 'BDC_SUBSCR' 'SAPLMLSP'.
PERFORM bdc_field USING 'BDC_CURSOR' 'ESLL-TBTWR(01)'.
PERFORM bdc_field USING i_ktext1 i_sap-txz01.
PERFORM bdc_field USING i_menge i_xleg-quant.
PERFORM bdc_field USING i_meins 'PU'.
PERFORM bdc_field USING i_tbtwr i_sap-netprice.
PERFORM bdc_dynpro USING 'SAPLMLSK' '0200'.
PERFORM bdc_field USING 'BDC_CURSOR' 'ESKN-SAKTO(01)'.
PERFORM bdc_field USING 'BDC_OKCODE' '/00'.
PERFORM bdc_field USING i_mkntm w_quant.
PERFORM bdc_field USING i_kostl w_costcenter.
PERFORM bdc_field USING i_sakto w_glaccount.
PERFORM bdc_dynpro USING 'SAPLMLSK' '0200'.
PERFORM bdc_field USING 'BDC_CURSOR' 'ESLL-INTROW'.
PERFORM bdc_field USING 'BDC_OKCODE' '=BACK'.
PERFORM bdc_dynpro USING 'SAPLMLSP' '0200'.
PERFORM bdc_field USING 'BDC_OKCODE' '=ESB'.
PERFORM bdc_field USING 'BDC_SUBSCR' 'SAPLMLSP'.
PERFORM bdc_field USING 'BDC_SUBSCR' 'SAPLMLSL'.
PERFORM bdc_field USING 'BDC_SUBSCR' 'SAPLMLSL'.
PERFORM bdc_field USING 'BDC_SUBSCR' 'SAPLMLSP'.
PERFORM bdc_field USING 'BDC_CURSOR' 'ESLL-KTEXT1(01)'.
ENDLOOP.
PERFORM bdc_dynpro USING 'SAPMM06E' '0120'.
PERFORM bdc_field USING 'BDC_OKCODE' '=BU'.
PERFORM bdc_transaction USING 'ME21'.
ENDIF.
ENDLOOP.
PERFORM close_group.
ENDFORM. " CREATE_BDC_SESSION
*& Form WRITE_RESULTS
FORM write_results.
WRITE: text-tx5, w_input_rec_count.
ENDFORM. " WRITE_RESULTS
*& Form OPEN_INPUT_FILE
FORM open_input_file.
OPEN DATASET p_input FOR INPUT IN TEXT MODE.
IF sy-subrc <> 0.
MESSAGE e000 WITH p_input.
ENDIF.
DO.
READ DATASET p_input INTO i_record_buffer.
IF sy-subrc <> 0.
EXIT.
ELSE.
SPLIT i_record_buffer-record_buffer AT c_delimiter INTO
i_leg-po_nm
i_leg-byrc
i_leg-vendor
i_leg-po_date
i_leg-cur
i_leg-zterm
i_leg-fob
i_leg-mat
i_leg-mat_pck
i_leg-quant
i_leg-u_meas
i_leg-del_date
i_leg-ven_mat
i_leg-net_pr
i_leg-ship_via
i_leg-del_loc
i_leg-dist_acc
i_leg-txz01
i_leg-recip
i_leg-line_cd
i_leg-comp
i_leg-line_num
i_leg-indicator
i_leg-projnbr
i_leg-works
i_leg-work_ord
i_leg-wbs
i_leg-cost_elem
i_leg-xref_wbs
i_leg-percent
i_leg-filler
i_leg-gl_act
i_leg-label
i_leg-iwg_warehouse
i_leg-cost_cen
i_leg-expence_cl
i_leg-tax_code
i_leg-quan_gr
i_leg-amt_gr
i_leg-quan_fi
i_leg-amt_fi
"Added by Naren Somen
i_leg-site.
* i_leg-flag
* i_leg-commit_amt.
APPEND i_leg.
ENDIF.
ENDDO.
DESCRIBE TABLE i_leg LINES w_input_rec_count.
CLOSE DATASET p_input.
ENDFORM. " OPEN_INPUT_FILE
*& Form OPEN_OUTPUT_ERROR_FILE
FORM open_output_error_file.
OPEN DATASET p_error FOR OUTPUT IN TEXT MODE.
IF sy-subrc <> 0.
MESSAGE e001 WITH p_error.
ENDIF.
ENDFORM. " OPEN_OUTPUT_ERROR_FILE
*& Form OPEN_GROUP
FORM open_group.
CALL FUNCTION 'BDC_OPEN_GROUP'
EXPORTING
client = sy-mandt
group = p_sess
user = p_uname
keep = 'X'.
ENDFORM. " OPEN_GROUP
*& Form BDC_DYNPRO
FORM bdc_dynpro USING program dynpro.
CLEAR bdcdata.
bdcdata-program = program.
bdcdata-dynpro = dynpro.
bdcdata-dynbegin = w_flg.
APPEND bdcdata.
CLEAR bdcdata.
ENDFORM. " BDC_DYNPRO
*& Form BDC_FIELD
FORM bdc_field USING fnam fval.
CLEAR bdcdata.
bdcdata-fnam = fnam.
bdcdata-fval = fval.
APPEND bdcdata.
CLEAR bdcdata.
ENDFORM. " BDC_FIELD
*& Form BDC_transaction
FORM bdc_transaction USING tran_code.
CALL FUNCTION 'BDC_INSERT'
EXPORTING
tcode = tran_code
TABLES
dynprotab = bdcdata.
CLEAR bdcdata.
REFRESH bdcdata.
ENDFORM. " BDC_TRANSACTION
*& Form CLOSE_GROUP
FORM close_group.
CALL FUNCTION 'BDC_CLOSE_GROUP'
EXCEPTIONS
not_open = 0
queue_error = 0
OTHERS = 0.
ENDFORM. " CLOSE_GROUP
*& Form READ_XREF_TABLES
* text
* --> p1 text
* <-- p2 text
FORM read_xref_tables.
CLEAR i_sap.
PERFORM convert_pur_group USING i_leg-byrc.
PERFORM convert_vendor USING i_leg-vendor.
PERFORM convert_payterm USING i_leg-zterm.
ENDFORM. " READ_XREF_TABLES
*& Form CONVERT_PUR_GROUP
FORM convert_pur_group USING p_byrc.
SELECT SINGLE ekgrp FROM /bay2/u7emxrbuyr
INTO w_purgrp
WHERE system_id EQ c_185 AND leginp_cd EQ p_byrc.
IF sy-subrc EQ 0.
MOVE w_purgrp TO i_sap-ekgrp.
CLEAR w_purgrp.
ENDIF.
ENDFORM. " CONVERT_PUR_GROUP
*& Form CONVERT_VENDOR
FORM convert_vendor USING p_vendor.
DATA : w_venfamily(8) TYPE c,
w_vendor_temp(7) TYPE c,
wa_vendor TYPE /bay2/u7pxxrvend,
wa_vendor1 TYPE /bay2/u7pxxrvend.
CLEAR: w_vendor, w_venfamily, w_vendor_temp.
* Select with Full Vendor Number
SELECT SINGLE * FROM /bay2/u7pxxrvend INTO wa_vendor
WHERE leg_ven_num EQ p_vendor AND system_id = c_185.
IF sy-subrc EQ 0.
IF wa_vendor-ktokk EQ 'YKRD'.
MOVE wa_vendor-lifnr TO w_vendor.
ELSE. " IF YSUP
* Select the YKRD for corrusponding YSUP from WYT3
SELECT ekorg lifnr
INTO (wyt3-ekorg, wyt3-lifnr)
FROM wyt3
WHERE
lifn2 EQ wa_vendor-lifnr.
SELECT SINGLE lifnr
INTO w_vendor
FROM wyt3
WHERE lifnr EQ wyt3-lifnr AND
ekorg EQ wyt3-ekorg AND
parvw EQ 'LF'.
IF sy-subrc EQ 0.
EXIT.
ENDIF.
ENDSELECT. " SELECT ekorg lifnr
ENDIF. " IF wa_vendor-ktokk EQ 'YKRD'.
ENDIF. " IF SY-SUBRC EQ 0.
IF w_vendor IS INITIAL.
* Select YKRD with Legacy Vendor Family Number
MOVE p_vendor TO w_vendor_temp.
CONCATENATE w_vendor_temp '%' INTO w_venfamily.
SELECT SINGLE * FROM /bay2/u7pxxrvend INTO wa_vendor1
WHERE leg_ven_num LIKE w_venfamily AND
ktokk EQ 'YKRD' AND system_id = c_185.
IF sy-subrc EQ 0.
MOVE wa_vendor1-lifnr TO w_vendor.
MOVE w_vendor TO i_sap-lifnr.
ELSE.
CONCATENATE p_vendor 'X' INTO i_sap-lifnr.
ENDIF.
ELSE.
MOVE w_vendor TO i_sap-lifnr.
ENDIF.
ENDFORM. " CONVERT_VENDOR
*& Form CONVERT_PAYTERM
FORM convert_payterm USING p_i_leg01_trms_code.
SELECT SINGLE zterm
INTO w_payterm
FROM /bay2/u7emcpterm
WHERE legpterm EQ p_i_leg01_trms_code AND system_id = c_185.
IF sy-subrc = 0.
MOVE w_payterm TO i_sap-zterm.
CLEAR w_payterm.
ENDIF.
ENDFORM. " CONVERT_PAYTERM
*& Form CONVERT_PLANT
FORM convert_plant USING p_works.
SELECT SINGLE werks FROM /bay2/u7smcpwerk
INTO w_plant
WHERE system_id EQ c_185
AND legwerks EQ p_works.
IF sy-subrc = 0.
MOVE w_plant TO i_sap-werks.
ENDIF.
ENDFORM. " CONVERT_PLANT
*& Form VENDOR_ADDRESS
* text
* --> p1 text
* <-- p2 text
FORM vendor_address.
REFRESH i_wyt3.
SELECT * FROM wyt3 INTO i_wyt3
WHERE lifnr EQ i_sap-lifnr
AND parza = c_partner_counter.
APPEND i_wyt3.
CLEAR i_wyt3.
ENDSELECT.
DESCRIBE TABLE i_wyt3 LINES w_address.
ENDFORM. " VENDOR_ADDRESS
*& Form ITEM_XREF_TABLES
FORM item_xref_tables.
PERFORM convert_plant USING i_xleg-works.
PERFORM convert_costcenter USING i_xleg-cost_cen
i_xleg-works.
PERFORM convert_glacc USING i_xleg-expence_cl.
MOVE: i_xleg-txz01(40) TO i_sap-txz01,
i_xleg-po_nm TO i_sap-po_nm,
i_xleg-filler+3(14) TO i_sap-netprice.
* i_xleg-commit_amt TO i_sap-commit_amt.
ENDFORM. " ITEM_XREF_TABLES
*& Form RECORD_COUNTER
FORM record_counter.
i_epstp-field3 = 1.
i_knttp-field3 = 1.
i_txz01-field3 = 1.
i_eeind-field3 = 1.
i_netpr-field3 = 1.
i_matkl-field3 = 1.
i_werks-field3 = 1.
i_ktext1-field3 = 1.
i_meins-field3 = 1.
i_menge-field3 = 1.
i_tbtwr-field3 = 1.
i_mkntm-field3 = 1.
i_kostl-field3 = 1.
i_sakto-field3 = 1.
i_ekpo_meins-field3 = 1.
i_ekpo_menge-field3 = 1.
w_count = 0.
ENDFORM.
*& Form LINE_ITEM_DATA
FORM line_item_data.
i_epstp-field3 = i_epstp-field3 + 1.
i_knttp-field3 = i_knttp-field3 + 1.
i_txz01-field3 = i_txz01-field3 + 1.
i_eeind-field3 = i_eeind-field3 + 1.
i_netpr-field3 = i_netpr-field3 + 1.
i_matkl-field3 = i_matkl-field3 + 1.
i_werks-field3 = i_werks-field3 + 1.
i_ekpo_menge-field3 = i_ekpo_menge-field3 + 1.
i_ekpo_meins-field3 = i_ekpo_meins-field3 + 1.
w_item = w_item + 10.
ENDFORM.
*& Form CONVERT_COSTCENTER
FORM convert_costcenter USING p_costcenter p_works.
CONCATENATE c_sq p_works p_costcenter c_zero INTO w_costcenter.
ENDFORM.
*& Form CONVERT_COSTCENTER
FORM convert_glacc USING w_expence_cl.
SELECT SINGLE kstar FROM /bay2/u7sxcrecce INTO i_kstar-kstar WHERE
leginp_cd EQ w_expence_cl.
MOVE i_kstar-kstar TO w_glaccount.
ENDFORM.
Thanks, -
hi guru's,
i have done a bdc rec prog.
here is the code:
perform open_group.
perform bdc_dynpro using 'SAPLMGMM' '0060'.
perform bdc_field using 'BDC_CURSOR'
'RMMG1-MATNR'.
*perform bdc_field using 'BDC_OKCODE'
'=ENTR'.*
perform bdc_field using 'RMMG1-MATNR'
wa_final-matnr.
perform bdc_dynpro using 'SAPLMGMM' '0070'.
perform bdc_field using 'BDC_CURSOR'
'MSICHTAUSW-DYTXT(02)'.
perform bdc_field using 'BDC_OKCODE'
'P+'.
perform bdc_field using 'MSICHTAUSW-KZSEL(01)'
'X'.
perform bdc_field using 'MSICHTAUSW-KZSEL(02)'
'X'.
perform bdc_dynpro using 'SAPLMGMM' '0070'.
perform bdc_field using 'BDC_CURSOR'
'MSICHTAUSW-DYTXT(17)'.
*perform bdc_field using 'BDC_OKCODE'
'=ENTR'.*
perform bdc_field using 'MSICHTAUSW-KZSEL(04)'
'X'.
perform bdc_field using 'MSICHTAUSW-KZSEL(14)'
'X'.
perform bdc_dynpro using 'SAPLMGMM' '0080'.
perform bdc_field using 'BDC_CURSOR'
'RMMG1-WERKS'.
perform bdc_field using 'BDC_OKCODE'
'=ENTR'.
perform bdc_field using 'RMMG1-WERKS'
plant.
perform bdc_dynpro using 'SAPLMGMM' '4004'.
perform bdc_field using 'BDC_OKCODE'
'=BABA'.
perform bdc_field using 'BDC_CURSOR'
'RMMG1-MATNR'.
perform bdc_transaction using 'MM03'.
{color}
Now my problem is, after pressing enter only iam able to select the views.
How to avoid this pressing of ENTER in the above program
*perform bdc_field using 'BDC_OKCODE'
'=ENTR'.*
so i need a key to replace this " '=ENTR'. " , which directly processes without me pressing enter key in my output.
regards,
chaituhi chaitanya,
use '/00' instead of '=enter'.
check this coading
*& Report ZMM_IMP
report zmm_imp
no standard page heading line-size 255.
*include bdcrecx1.
include zfin1_include.
selection-screen begin of block blk3 with frame title text-019.
parameters : pa_fname type localfile.
selection-screen end of block blk3.
data : lv_fname type string.
data: begin of record occurs 2,
matnr_001(018), " MATERIAL NUMBER
maktx_019(040), " MATERIAL DESCRIPTION
meins_020(003), " BUM
matkl_021(009), " MATERIAL NUMBER
check_820(001),
aennr_821(003),
revlv_822(003),
extwg_850(018), " added for prod. server
spart_023(002),
kosch_851(018), " added for prod serv
normt_900(018), " added 600
wrkst_901(048), " added 600
bstme_023(003),
ekgrp_025(003), " PURCHASING GROUP
ekwsl_027(004), " PURCHASING VALUE KEY
usequ_028(001), " QUOTA ARRAY USAGE
kordb_029(001), " SOURCE LIST
umren_030(006),
umrez_031(006),
stawn_036(017), " IMPORT CODE NUMBER
steuc_037(016), " CONTROL CODE
j_1ichid_038(012),
j_1isubind_039(001),
j_1icapind_040(001),
j_1igrxref_041(001),
j_1imoom_042(018),
j_1iwaers_043(005),
j_1ivalass_044(018),
maabc_049(001), " ABC INDICATOR
minbe_051(017), " REORDER POINT
dispo_052(003), " MRP CONTROLLER
disls_053(002), " LOT SIZE
bstmi_054(017), " MIN LOT SIZE
mabst_055(017), " MAX STOCK LVL
sobsl_068(002), " SPL PROCUREMENT
plifz_071(003), " PLD DEL TIME
webaz_072(003), " GR PROCESS TIME
eisbe_074(017), " SAFETY STOCK
rwpro_075(003), " COV PROFILE
strgr_076(002),
miskz_078(001), " MIXED MRP MRP-3 VIEW START
mtvfp_079(002), " AVAILABILITY CHK
sbdkz_081(001), " COLL MRP-4 VIEW
lgpbe_089(010), " STORAGE BIN
xmcng_092(001), " NEG STOCKS
loggr_093(004), "LOG HANDLING GROUP
qmpur_097(001), " QM IN PROC
ssqss_098(008), " QM CTRL KEY
art_01_800(008), " INSP TYPE
art_02_801(008),
art_03_802(008),
art_04_803(008),
art_05_804(008),
aktiv_01_805(001), " ACTIVATION
aktiv_02_806(001),
aktiv_03_807(001),
aktiv_04_808(001),
aktiv_05_809(001),
art_01_810(008),
art_02_811(008),
art_03_812(008),
aktiv_01_813(001),
aktiv_02_814(001),
aktiv_03_815(001),
bklas_123(004), " VALUATION CLASS
vprsv_124(001), " PRICE CONTROL
peinh_125(006), " PRICE UNIT
verpr_126(015), " MVG AVG PRICE
stprs_127(011), "MBEW -- STD PRICE
losgr_130(017), " COST LOT SIZE
end of record.
End generated data section ***
at selection-screen on value-request for pa_fname.
call function 'F4_FILENAME'
exporting
program_name = syst-cprog
dynpro_number = syst-dynnr
field_name = 'PA_FNAME'
importing
file_name = pa_fname.
start-of-selection.
lv_fname = pa_fname.
perform open_group.
call function 'GUI_UPLOAD'
exporting
filename = lv_fname
filetype = 'ASC'
has_field_separator = 'X'
tables
data_tab = record
if sy-subrc <> 0.
endif.
loop at record.
if sy-subrc <> 0. exit. endif.
perform bdc_dynpro using 'SAPLMGMM' '0060'.
perform bdc_field using 'BDC_CURSOR'
'RMMG1-MATNR'.
perform bdc_field using 'BDC_OKCODE'
'/00'.
perform bdc_field using 'RMMG1-MATNR'
record-matnr_001.
perform bdc_field using 'RMMG1-MBRSH'
'M'.
perform bdc_field using 'RMMG1-MTART'
'I'.
perform bdc_dynpro using 'SAPLMGMM' '0070'.
perform bdc_field using 'BDC_CURSOR'
'MSICHTAUSW-DYTXT(17)'.
perform bdc_field using 'BDC_OKCODE'
'P+'.
perform bdc_field using 'MSICHTAUSW-KZSEL(01)'
'X'.
perform bdc_field using 'MSICHTAUSW-KZSEL(02)'
'X'.
perform bdc_field using 'MSICHTAUSW-KZSEL(04)'
'X'.
perform bdc_field using 'MSICHTAUSW-KZSEL(05)'
'X'.
perform bdc_field using 'MSICHTAUSW-KZSEL(06)'
'X'.
perform bdc_field using 'MSICHTAUSW-KZSEL(08)'
'X'.
perform bdc_field using 'MSICHTAUSW-KZSEL(09)'
'X'.
perform bdc_field using 'MSICHTAUSW-KZSEL(10)'
'X'.
perform bdc_field using 'MSICHTAUSW-KZSEL(11)'
'X'.
perform bdc_field using 'MSICHTAUSW-KZSEL(12)'
'X'.
perform bdc_field using 'MSICHTAUSW-KZSEL(13)'
'X'.
perform bdc_field using 'MSICHTAUSW-KZSEL(14)'
'X'.
perform bdc_field using 'MSICHTAUSW-KZSEL(15)'
'X'.
perform bdc_field using 'MSICHTAUSW-KZSEL(17)'
'X'.
perform bdc_dynpro using 'SAPLMGMM' '0070'.
perform bdc_field using 'BDC_CURSOR'
'MSICHTAUSW-DYTXT(01)'.
perform bdc_field using 'BDC_OKCODE'
'=ENTR'.
perform bdc_field using 'MSICHTAUSW-KZSEL(01)'
'X'.
perform bdc_field using 'MSICHTAUSW-KZSEL(04)'
'X'.
perform bdc_field using 'MSICHTAUSW-KZSEL(05)'
'X'.
perform bdc_field using 'MSICHTAUSW-KZSEL(07)'
'X'.
perform bdc_dynpro using 'SAPLMGMM' '0080'.
perform bdc_field using 'BDC_CURSOR'
'RMMG1-LGORT'.
perform bdc_field using 'BDC_OKCODE'
'=ENTR'.
perform bdc_field using 'RMMG1-WERKS'
'PMT1'.
perform bdc_field using 'RMMG1-LGORT'
'RMST'.
perform bdc_field using 'RMMG1-VKORG'
'PMSO'.
perform bdc_field using 'RMMG1-VTWEG'
'DC'.
perform bdc_dynpro using 'SAPLMGMM' '4004'.
perform bdc_field using 'BDC_OKCODE'
'=RLVP'.
perform bdc_field using 'MAKT-MAKTX'
record-maktx_019.
perform bdc_field using 'BDC_CURSOR'
'MARA-MATKL'.
perform bdc_field using 'MARA-MEINS'
record-meins_020.
perform bdc_field using 'MARA-MATKL'
record-matkl_021.
if record-check_820 = 'X'.
perform bdc_dynpro using 'SAPLCCRL' '0600'.
perform bdc_field using 'BDC_CURSOR'
'RC29A-REVLV'.
perform bdc_field using 'BDC_OKCODE'
'=WEIT'.
perform bdc_field using 'RC29A-AENNR'
record-aennr_821.
perform bdc_field using 'RC29A-REVLV'
record-revlv_822.
perform bdc_dynpro using 'SAPLMGMM' '4004'.
endif.
perform bdc_field using 'BDC_OKCODE'
'=SP02'.
perform bdc_field using 'MARA-EXTWG'
record-extwg_850.
perform bdc_field using 'MARA-SPART'
record-spart_023.
perform bdc_field using 'MARA-kosch'
record-kosch_851.
perform bdc_dynpro using 'SAPLMGMM' '4004'.
perform bdc_field using 'BDC_OKCODE'
'/00'.
perform bdc_field using 'BDC_CURSOR'
'MARA-NORMT'.
perform bdc_field using 'MARa-NORMT'
record-normt_900.
perform bdc_field using 'MARa-WRKST'
record-wrkst_901.
perform bdc_dynpro using 'SAPLMGMM' '4000'.
perform bdc_field using 'BDC_OKCODE'
'/00'.
perform bdc_field using 'BDC_CURSOR'
'MVKE-DWERK'.
perform bdc_field using 'MVKE-DWERK'
'PMT1'.
perform bdc_field using 'MG03STEUER-TAXKM(01)'
'1'.
perform bdc_dynpro using 'SAPLMGMM' '4200'.
perform bdc_field using 'BDC_OKCODE'
'=MAIN'.
perform bdc_field using 'BDC_CURSOR'
'MAKT-MAKTX'.
perform bdc_dynpro using 'SAPLMGMM' '4000'.
perform bdc_field using 'BDC_OKCODE'
'=SP05'.
perform bdc_field using 'BDC_CURSOR'
'MAKT-MAKTX'.
perform bdc_dynpro using 'SAPLMGMM' '4000'.
perform bdc_field using 'BDC_OKCODE'
'=SP06'.
perform bdc_field using 'BDC_CURSOR'
'MVKE-KTGRM'.
perform bdc_field using 'MVKE-VERSG'
'1'.
perform bdc_field using 'MVKE-KTGRM'
'01'.
perform bdc_field using 'MARA-MTPOS_MARA'
'NORM'.
perform bdc_field using 'MVKE-MTPOS'
'NORM'.
perform bdc_dynpro using 'SAPLMGMM' '4000'.
perform bdc_field using 'BDC_OKCODE'
'=SP09'.
perform bdc_field using 'BDC_CURSOR'
'MARC-LADGR'.
perform bdc_field using 'MARC-MTVFP'
'01'.
perform bdc_field using 'MARA-TRAGR'
'0001'.
perform bdc_field using 'MARC-LADGR'
'0001'.
perform bdc_dynpro using 'SAPLMGMM' '4000'.
perform bdc_field using 'BDC_OKCODE'
'/00'.
perform bdc_field using 'MARa-bstme'
record-bstme_023.
perform bdc_field using 'MARC-EKGRP'
record-ekgrp_025.
perform bdc_field using 'BDC_CURSOR'
'MARA-EKWSL'.
perform bdc_field using 'MARA-EKWSL'
record-ekwsl_027.
perform bdc_field using 'MARC-USEQU'
record-usequ_028.
perform bdc_field using 'MARC-KORDB'
record-kordb_029.
if record-bstme_023 <> ' '.
perform bdc_dynpro using 'SAPLMGMM' '0510'.
perform bdc_field using 'BDC_CURSOR'
'RMMZU-UMREZ'.
perform bdc_field using 'BDC_OKCODE'
'=ENTR'.
perform bdc_field using 'RMMZU-UMREN'
record-umren_030.
perform bdc_field using 'RMMZU-UMREZ'
record-umrez_031.
endif.
*perform bdc_dynpro using 'SAPLMGMM' '4000'.
*perform bdc_field using 'BDC_OKCODE'
'=SP10'.
perform bdc_dynpro using 'SAPLMGMM' '4000'.
perform bdc_field using 'BDC_OKCODE'
'SP12'.
perform bdc_field using 'MARC-STAWN'
record-stawn_036.
perform bdc_field using 'MARC-STEUC'
record-steuc_037.
perform bdc_field using 'J_1IMTCHID-J_1ICHID'
record-j_1ichid_038.
perform bdc_field using 'J_1IMTCHID-J_1ISUBIND'
record-j_1isubind_039.
perform bdc_field using 'J_1IMTCHID-J_1ICAPIND'
record-j_1icapind_040.
perform bdc_field using 'J_1IMTCHID-J_1IGRXREF'
record-j_1igrxref_041.
perform bdc_field using 'J_1IMODDET-J_1IMOOM'
record-j_1imoom_042.
perform bdc_field using 'J_1IASSVAL-J_1IWAERS'
record-j_1iwaers_043.
perform bdc_field using 'J_1IASSVAL-J_1IVALASS'
record-j_1ivalass_044.
perform bdc_dynpro using 'SAPLMGMM' '4000'.
perform bdc_field using 'BDC_OKCODE'
'=SP13'.
perform bdc_field using 'MARC-DISGR'
'0000'.
perform bdc_field using 'MARC-MAABC'
record-maabc_049.
perform bdc_field using 'BDC_CURSOR'
'MARC-DISPO'.
perform bdc_field using 'MARC-DISMM'
'PD'.
perform bdc_field using 'MARC-MINBE'
record-minbe_051.
perform bdc_field using 'MARC-DISPO'
record-dispo_052.
perform bdc_field using 'MARC-DISLS'
record-disls_053.
perform bdc_field using 'MARC-BSTMI'
record-bstmi_054.
perform bdc_field using 'MARC-MABST'
record-mabst_055.
perform bdc_dynpro using 'SAPLMGMM' '4000'.
perform bdc_field using 'BDC_OKCODE'
'=SP14'.
perform bdc_field using 'MARC-SOBSL'
record-sobsl_068.
perform bdc_field using 'MARC-LGPRO'
'RMST'.
perform bdc_field using 'MARC-LGFSB'
'RMST'.
perform bdc_field using 'MARC-PLIFZ'
record-plifz_071.
perform bdc_field using 'MARC-WEBAZ'
record-webaz_072.
perform bdc_field using 'MARC-FHORI'
'000'.
perform bdc_field using 'BDC_CURSOR'
'MARC-RWPRO'.
perform bdc_field using 'MARC-EISBE'
record-eisbe_074.
perform bdc_field using 'MARC-RWPRO'
record-rwpro_075.
perform bdc_dynpro using 'SAPLMGMM' '4000'.
perform bdc_field using 'BDC_OKCODE'
'=SP15'.
perform bdc_field using 'MARC-strgr'
record-strgr_076.
perform bdc_field using 'MARC-MISKZ'
record-miskz_078.
perform bdc_field using 'BDC_CURSOR'
'MARC-MTVFP'.
perform bdc_field using 'MARC-MTVFP'
record-mtvfp_079.
perform bdc_dynpro using 'SAPLMGMM' '4000'.
perform bdc_field using 'BDC_OKCODE'
'/00'.
perform bdc_field using 'BDC_CURSOR'
'MARC-SBDKZ'.
perform bdc_field using 'MARC-SBDKZ'
record-sbdkz_081.
perform bdc_dynpro using 'SAPLMGMM' '4000'.
perform bdc_field using 'BDC_OKCODE'
'=SP19'.
perform bdc_dynpro using 'SAPLMGMM' '4000'.
perform bdc_field using 'BDC_OKCODE'
'=SP20'.
perform bdc_field using 'BDC_CURSOR'
'MARD-LGPBE'.
perform bdc_field using 'MARD-LGPBE'
record-lgpbe_089.
perform bdc_dynpro using 'SAPLMGMM' '4000'.
perform bdc_field using 'BDC_OKCODE'
'SP23'.
perform bdc_field using 'BDC_CURSOR'
'MARC-LOGGR'.
perform bdc_field using 'MARC-XMCNG'
record-xmcng_092.
perform bdc_field using 'MARC-LOGGR'
record-loggr_093.
perform bdc_dynpro using 'SAPLMGMM' '4000'.
perform bdc_field using 'BDC_OKCODE'
'=PB01'.
perform bdc_field using 'BDC_CURSOR'
'MARC-SSQSS'.
perform bdc_field using 'MARA-QMPUR'
record-qmpur_097.
perform bdc_field using 'MARC-SSQSS'
record-ssqss_098.
perform bdc_dynpro using 'SAPLQPLS' '0100'.
perform bdc_field using 'BDC_CURSOR'
'RMQAM-ARGUMENT'.
perform bdc_field using 'BDC_OKCODE'
'=NEU'.
perform bdc_dynpro using 'SAPLQPLS' '0100'.
perform bdc_field using 'BDC_CURSOR'
'RMQAM-AKTIV(05)'.
perform bdc_field using 'BDC_OKCODE'
'P+'.
perform bdc_field using 'RMQAM-ART(01)'
record-art_01_800.
perform bdc_field using 'RMQAM-ART(02)'
record-art_02_801.
perform bdc_field using 'RMQAM-ART(03)'
record-art_03_802.
perform bdc_field using 'RMQAM-ART(04)'
record-art_04_803.
perform bdc_field using 'RMQAM-ART(05)'
record-art_05_804.
perform bdc_field using 'RMQAM-AKTIV(01)'
record-aktiv_01_805.
perform bdc_field using 'RMQAM-AKTIV(02)'
record-aktiv_02_806.
perform bdc_field using 'RMQAM-AKTIV(03)'
record-aktiv_03_807.
perform bdc_field using 'RMQAM-AKTIV(04)'
record-aktiv_04_808.
perform bdc_field using 'RMQAM-AKTIV(05)'
record-aktiv_05_809.
perform bdc_dynpro using 'SAPLQPLS' '0100'.
perform bdc_field using 'BDC_CURSOR'
'RMQAM-ARGUMENT'.
perform bdc_field using 'BDC_OKCODE'
'=NEU'.
perform bdc_dynpro using 'SAPLQPLS' '0100'.
perform bdc_field using 'BDC_CURSOR'
'RMQAM-AKTIV(03)'.
perform bdc_field using 'BDC_OKCODE'
'=WEIT'.
perform bdc_field using 'RMQAM-ART(01)'
record-art_01_810.
perform bdc_field using 'RMQAM-ART(02)'
record-art_02_811.
perform bdc_field using 'RMQAM-ART(03)'
record-art_03_812.
perform bdc_field using 'RMQAM-AKTIV(01)'
record-aktiv_01_813.
perform bdc_field using 'RMQAM-AKTIV(02)'
record-aktiv_02_814.
perform bdc_field using 'RMQAM-AKTIV(03)'
record-aktiv_03_815.
perform bdc_dynpro using 'SAPLMGMM' '4000'.
perform bdc_field using 'BDC_OKCODE'
'=SP24'.
perform bdc_dynpro using 'SAPLMGMM' '4000'.
perform bdc_field using 'BDC_OKCODE'
'=SP26'.
perform bdc_field using 'BDC_CURSOR'
'MBEW-VERPR'.
perform bdc_field using 'MBEW-BKLAS'
record-bklas_123.
perform bdc_field using 'MBEW-VPRSV'
record-vprsv_124.
perform bdc_field using 'MBEW-PEINH'
record-peinh_125.
perform bdc_field using 'MBEW-VERPR'
record-verpr_126.
perform bdc_field using 'MBEW-STPRS'
record-stprs_127.
perform bdc_dynpro using 'SAPLMGMM' '4000'.
perform bdc_field using 'BDC_OKCODE'
'/00'.
perform bdc_field using 'BDC_CURSOR'
'MARC-PRCTR'.
perform bdc_field using 'MARC-LOSGR'
record-losgr_130.
perform bdc_dynpro using 'SAPLSPO1' '0300'.
perform bdc_field using 'BDC_OKCODE'
'=YES'.
perform bdc_transaction using 'MM01'.
endloop.
perform close_group. -
To display flatfile rec's under 1 Alternative BOM using BDc recording.
Hi,
I m trying to display flat file entire(i.e.. 4 rec's i m using) records vertically under one (Alternative BOM) for CS01-BOM using BDC recording method.
Now i m tried with the following code,i m getting as one (Alternative BOM) for one ff record,by replacing one by one.
But i want as vertically under one (Alternative BOM).
Can anyone help me to overcome this.
report ZBOM
no standard page heading line-size 255.
*include bdcrecx1.
DATA: BEGIN OF bdc OCCURS 0,
matnr(18),
werks(4),
stlan(1),
END OF BDC.
DATA: BEGIN OF BDC1 OCCURS 0,
idnrk(18),
MENGE(18),
MEINS(3),
postp(1),
posnr(4),
END OF bdc1.
DATA: BEGIN OF BDCDATA OCCURS 0,
matnr(18),
werks(4),
stlan(1),
idnrk(18),
MENGE(18),
MEINS(3),
postp(1),
posnr(4),
END OF BDCDATA.
data ibdcdata type standard table of bdcdata WITH header line.
*start-of-selection.
CALL FUNCTION 'GUI_UPLOAD'
EXPORTING
FILENAME = 'C:\Documents and Settings\dilipkumar.b\Desktop\soft.txt'
FILETYPE = 'ASC'
HAS_FIELD_SEPARATOR = ','
HEADER_LENGTH = 0
READ_BY_LINE = 'X'
DAT_MODE = ' '
CODEPAGE = ' '
IGNORE_CERR = ABAP_TRUE
REPLACEMENT = '#'
CHECK_BOM = ' '
VIRUS_SCAN_PROFILE =
NO_AUTH_CHECK = ' '
IMPORTING
FILELENGTH =
HEADER =
TABLES
DATA_TAB = BDCDATA
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.
*perform open_group.
loop at bdcdata.
perform bdc_dynpro using 'SAPLCSDI' '0100'.
perform bdc_field using 'BDC_CURSOR'
'RC29N-STLAN'.
perform bdc_field using 'BDC_OKCODE'
'/00'.
perform bdc_field using 'RC29N-MATNR'
'SOFTDRINKS'.
perform bdc_field using 'RC29N-WERKS'
'WIND'.
perform bdc_field using 'RC29N-STLAN'
'1'.
perform bdc_field using 'RC29N-DATUV'
'16.09.2008'.
perform bdc_dynpro using 'SAPLCSDI' '0110'.
perform bdc_field using 'BDC_OKCODE'
'/00'.
perform bdc_field using 'RC29K-BMENG'
'1'.
perform bdc_field using 'RC29K-STLST'
'1'.
perform bdc_field using 'BDC_CURSOR'
'RC29K-EXSTL'.
perform bdc_dynpro using 'SAPLCSDI' '0111'.
perform bdc_field using 'BDC_CURSOR'
'RC29K-LABOR'.
perform bdc_field using 'BDC_OKCODE'
'/00'.
perform bdc_dynpro using 'SAPLCSDI' '0140'.
perform bdc_field using 'BDC_CURSOR'
'RC29P-POSTP(01)'.
perform bdc_field using 'BDC_OKCODE'
'=FCBU'.
perform bdc_field using 'RC29P-IDNRK(001)'
BDCDATA-IDNRK.
perform bdc_field using 'RC29P-MENGE(001)'
BDCDATA-MENGE.
perform bdc_field using 'RC29P-MEINS(001)'
BDCDATA-MEINS.
perform bdc_field using 'RC29P-POSTP(001)'
BDCDATA-POSTP.
perform bdc_dynpro using 'SAPLCSDI' '0130'.
perform bdc_field using 'BDC_OKCODE'
'/00'.
perform bdc_field using 'BDC_CURSOR'
'RC29P-POSNR'.
perform bdc_field using 'RC29P-POSNR'
BDCDATA-POSNR. "'0010'.
perform bdc_field using 'RC29P-IDNRK'
BDCDATA-IDNRK. "'15'.
perform bdc_field using 'RC29P-MENGE'
BDCDATA-MENGE. "'1'.
perform bdc_field using 'RC29P-MEINS'
BDCDATA-MEINS. "'ml'.
perform bdc_dynpro using 'SAPLCSDI' '0131'.
perform bdc_field using 'BDC_OKCODE'
'/00'.
perform bdc_field using 'BDC_CURSOR'
'RC29P-POTX1'.
perform bdc_field using 'RC29P-SANKA'
'X'.
*perform bdc_transaction using 'CS01'.
*perform close_group.
CALL TRANSACTION 'CS01' USING IBDCDATA MODE 'A' UPDATE 'S'.
REFRESH IBDCDATA.
clear ibdcdata.
endloop.
Start new screen *
FORM BDC_DYNPRO USING PROGRAM DYNPRO.
CLEAR iBDCDATA.
iBDCDATA-PROGRAM = PROGRAM.
iBDCDATA-DYNPRO = DYNPRO.
iBDCDATA-DYNBEGIN = 'X'.
APPEND ibDCDATA .
ENDFORM.
Insert field *
FORM BDC_FIELD USING FNAM FVAL.
IF FVAL NODATA.
CLEAR iBDCDATA.
iBDCDATA-FNAM = FNAM.
iBDCDATA-FVAL = FVAL.
APPEND iBDCDATA .
ENDIF.
ENDFORM.Hi Dilip,
Please change your code.
I request you to please go through BDC tutorials before even starting to write the program.
There are many online tutorials which can help you with.
Also, search in SDN.. there you will get more than thousand results.. with the search term BDC.
Take this suggestion seriously before nayone reports the moderators that u have been posting this thread daily without taking into consideration the previous replies.
Regards,
Vishwa. -
Reg: is there any transaction for whcich bdc cannot be done
Dear Friends,
I would like to know if there is any transaction for which bdc cannot be done.
I would like to know the reason, if there is any transaction like that.
I have been asked the same in an session by a senior person.
Reg
Ravi.Hi RaviShankar,
There are so many tcodes for which BDC cannot be done. There many be several reasons for that.
Here is an example for that.
The Tcode FIBPU. If you enter vendor or custome details along with hose bank details. You will get an interactive report data, if you click it will take you to the respective line related information screen. For each line the data will be different along with screens. But for this BDC is not possible.
Thanks
Manju. -
Reg : BDC issue while updating infotype 40 inside BADI class method
Hi Friends,
Actually in my badi class, there is a method where i need to save the infotype fields including comment fields.. So with BDC recording i recorded screen fields and passing the pernr internal table values to recorded pernr values.. by doing this im getting error and so BDC is not upadting the data.. moreover if i pass directly pernr number within single quotes, BDC is working fine and data is getting updated..
bdc_field 'RP50G-PERNR' pernr. --> Error Message while calling transaction through BDC
bdc_field 'RP50G-PERNR' '00001234' ---> updating successfully..
1. Tell me whether the issue is with BADI or wat ? means we cant able to use BDC inside badi ?
2. I also tried changing my internal table value of pernr to type 'C' of length 8.. eventhough its showing error..
Please tell me what i need to do .... ?Hi Dilek Ersoz Adak ,
I also tried with that, but getting same error.. Below is my error im getting while updating BDC through call transaction,
1 PA30 SAPMP50A 1000 E K PBAS_SERVICE 001 HRADMIN EPPRELE 00000121 HRAdministrator CTU RP50G-PERNR
Person is treated already by the HR Administrator -
using we can transfer the data from one system and another system. in ale also we can do same thing. what is the need of using ale
BDC is used in scenarios where a company decides to do away with an existing ERP system and choses to use a SAP R/3 system in its place(Like from Oracle to SAP, or from any legacy system to SAP).
In the process, the company wil store all the legacy data in flat files before discarding the original system.
The flat file data, will have to be uploaded into the R/3 System again. It such cases BDCs/ Batch Iput programs are used.
ALEs are used in a totally different scenario.
If the company is using two loosely coupled sap systems, and the same data is to be maintained in both the systems, then you will use ALE concept.
It is like latching them together and changes made to one system are automatically refelected in the other system as well.
Regards,
Ravi -
Reg: ME21 Purchase Order Creation BDC Codes
Hi All,
Ritenow Im working with ME21 purchase order creation,
i have to create a upload program for this past twodays im geting hectic with this prog, if i create a prog using me21n transaction it is not running, and in ME21 i cant record in SHDB( it throws error messg as fill mandatory flds, but i dont hav data for that flds).
Anyone plz let me know, how to record it and how to use step loop in item overview/details, i would like ot close it ASP.
Thanks in advance.hi
Creating an ABAP program from a BDC recording
Step 1
Execute transaction recorder, transaction SHDB or recording button via transaction SM35.
Step 2
Enter name for recording (can be anything)
Step 3
Enter transaction to be executed
Step 4
The transaction will now be executed, simply perform the actions you want to record. enter some values for the mandatory fields.
Step 5
Once you have finished the recording and selected the save button or exited the transaction you
Will be presented with the following information. This details the screens and fields that have been
Processed during the recording and will be used as a basis to create BDC ABAP program. -
Reg : Error in flat file in BDC
hi friends...
let consider 10 records in my flat file...
suppose 5th record is error means
In BDC Session method, what happen records before and after the error record, its get update or not ? like
In BDC Call Transaction method, what happen records before and after the error record, its get update or not ?
please give me some detail...
Regards
SelvaHi,
In call transaction method you will have an option of Displaying No screens, all screens and Error screens,
If you select No screens all other records except error records will be process and messages will be collected by an internal table of type bdcmsgcoll.
In all screens you need to process each screen manually yourself by selecting the OK code. It is kinda like debugging. So when you encounter the error screen you can change the error data and proceed.
When you select error screens it will stop when the error occurs. So you need to correct the error and continue with the further processing.
Regards,
Pramod -
Reg:how to post the parked documents using BDC
Duplicate message in General deleted. Please do not post the same question in more than one forum.
Hi
I am creating parked Documents using FV50. I am able to check them using FBV0, I am able to select and post the documents using the same transaction. Its working fine. However I want to post the selected parked documents using BDC. I am having problems as the output in FBV0 is in ALV report format. HAving problems selcting the parked documents to be posted. As there any way to post the selected parked documents using BDC.
Please suggest me a solution for this.
Thanks,
Satish
Edited by: Matt on Dec 3, 2008 7:40 PMHi Rob,
Thank you for ur reply, can u send that code how u post the parked documents using BDC for FBV0 transaction. Please send the code.
Thanks,
Satish
Maybe you are looking for
-
On the bottom bar of firefox i have-- (c)sunny folk-- showing up . Any ideas?
Where the print is it has a white background. When a website is loading the print is still visible, but covered with the website info. After loading on the display bar it displays --done-- on the left hand side. Seems to be acting normal . Any ideas?
-
Beware! I had a call to my cell phone saying that I had won $74.00 and I needed to go to "74verizon.com" to claim it. The web address exists, and it looks just like Verizon -- it even has all the links to other parts of Verizon's website -- but the l
-
My client is experiencing problems viewing my draft website made available to them online via the Publish button in Muse CC (2014.0.1.30). Initially each page Explorer 8 (used on a PC) opens comes up with a dialogue that says "MuseJSAssert: Error cal
-
Hi, i would like to know any table or FM to get the object name and description corresponding to the field ADIRACCESS-OBJ_NAME is available. i have searched the table TRDIRT but only for the report program name description is available. i want the e
-
Hi! On July First, after kernek update - kernel26.2.6.17.3-1, powemanagement on my computer stop working correct. In the KDE Control Center - Peripherals - Display _power Control I have checked Enable power...and it works correct to the last update.