2023 May 19 8:29 AM
Hi All,
We have created a BDC report to create scheduling lines with reference to PR and it is working fine. we upload Scheduling agreement , PO item, delivery date, PR and PR item from excel.
Now I am increasing the count in BDC to auto increase the bdc_cursor to pick one line item after the other as shown in below screenshot.
now if the excel file contains only 2 records how to pick the correct material with respect to PR item.
suppose we have only 2 records in excel as below.
and for the above scheduling agreement no we have 4 items with different material code. How to auto select the correct line items .
2023 May 19 10:14 AM
Could you consider using a BAPI such as BAPI_SCHEDULE_MAINTAIN or BAPI_PO_CHANGE?
2023 May 19 1:06 PM
Yes, sure. Can we use these BAPI to create scheduling line with respect to PR like we do in ME38. We just want to make PR mandatory while creating Scheduling lines.
2023 May 19 1:15 PM
I checked this BAPI BAPI_SCHEDULE_MAINTAIN, we need to pass PO number which is mandatory, how can we do it with PR. Kindly sugest.
2023 May 22 7:34 AM
Hi Raymond,
Did you find any solution how to pass PR to these bapi.
2023 May 22 12:35 PM
Pass the same value that you passed in first dynpro of the batch-input recording (actually it's 'Purchasing document number of the scheduling agreement')
2023 May 24 7:29 AM
No Sir, It is scheduling agreement number, also I tried to pass it but it is showing error " document not available'.
2023 May 22 7:33 AM
2023 May 22 10:08 AM
Hello, to position the cursor on a specific line the line is first to be selected by populating the line item number in the field RM06E-EBELP (Field for Positioning Within Overview Screen). By doing so the cursor is positioned on the first line of the overview screen and you can select field by using index (1).
2023 May 23 5:19 AM
Hi Graus,
Thanks for the info, but after passing my Internal table value to "RM06E-EBELP" field also it is not working. I am sharing my code, kindly suggest if any other changes I need to make.
PERFORM bdc_dynpro USING 'SAPMM06E' '0205'.
PERFORM bdc_field USING 'BDC_CURSOR'
'RM06E-EVRTN'.
PERFORM bdc_field USING 'BDC_OKCODE'
'/00'.
PERFORM bdc_field USING 'RM06E-EVRTN'
"'5500002360'.
wa_data-evrtn.
PERFORM bdc_dynpro USING 'SAPMM06E' '0222'.
CONCATENATE 'EKPO-EMATN(' lv_count ')' INTO lv_string.
PERFORM bdc_field USING 'BDC_CURSOR'
"'EKPO-EMATN(1)'.
lv_string.
PERFORM bdc_field USING 'BDC_OKCODE'
'=ET'.
PERFORM bdc_field USING 'RM06E-EBELP'
"'10'.
wa_data-ebelp.
PERFORM bdc_dynpro USING 'SAPMM06E' '1117'.
PERFORM bdc_field USING 'BDC_CURSOR'
'RM06E-LPEIN(01)'.
PERFORM bdc_field USING 'BDC_OKCODE'
'=BS'.
PERFORM bdc_dynpro USING 'SAPMM06E' '0501'.
PERFORM bdc_field USING 'BDC_CURSOR'
'EKET-BNFPO'.
PERFORM bdc_field USING 'BDC_OKCODE'
'ENTE'.
PERFORM bdc_field USING 'EKET-BANFN'
"'11274756'.
wa_data-banfn.
PERFORM bdc_field USING 'EKET-BNFPO'
"'1330'.
wa_data-bnfpo.
PERFORM bdc_field USING 'EBAN-EKGRP'
"'121'.
wa_eban.
PERFORM bdc_dynpro USING 'SAPMM06E' '0125'.
PERFORM bdc_field USING 'BDC_OKCODE'
'=REFH'.
PERFORM bdc_dynpro USING 'SAPMM06E' '0125'.
PERFORM bdc_field USING 'BDC_CURSOR'
'EBAN-BANFN(01)'.
PERFORM bdc_field USING 'BDC_OKCODE'
'=REFH'.
PERFORM bdc_field USING 'RM06E-TCSELFLAG(01)'
'X'.
PERFORM bdc_dynpro USING 'SAPMM06E' '1117'.
PERFORM bdc_field USING 'BDC_CURSOR'
'EKET-SLFDT(01)'.
PERFORM bdc_field USING 'BDC_OKCODE'
'/00'.
PERFORM bdc_field USING 'RM06E-ETNR1'
' 1'.
PERFORM bdc_field USING 'EKET-MENGE(01)'
"' 3'.
wa_data-qty.
PERFORM bdc_field USING 'EKET-SLFDT(01)'
"'30.05.2023'.
wa_data-date.
PERFORM bdc_dynpro USING 'SAPMM06E' '1117'.
PERFORM bdc_field USING 'BDC_CURSOR'
'EKET-SLFDT(01)'.
PERFORM bdc_field USING 'BDC_OKCODE'
'=BU'.
PERFORM bdc_field USING 'RM06E-ETNR1'
' 1'.
PERFORM bdc_dynpro USING 'SAPLSPO1' '0300'.
PERFORM bdc_field USING 'BDC_OKCODE'
'=YES'.
2023 May 23 5:31 AM
In my above code I am incrementing the line index number 'EKPO-EMATN(1)' and it is also working fine as long as we maintain the data accordingly in the excel. But it is not selecting the line items according to po item(EBELP).
2023 May 23 8:44 AM
pritam_baboo could you elaborate a bit regarding your issue? I can't understand the part of your statement below:
-> How to auto select the correct line items .
is your data in the excel starting from the 4th row failed to be inserted during BDC process?