Application Development Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 

Batch Input ML81N

zuerbesm
Discoverer
0 Kudos
583

Hallo,

ich habe einen BI, der das anlegen von Erfassungsblättern in der ML81N simuliert. Dieser ist für das monatliche Leasing von Fahrzeugen angedacht. Prinzipiell funktioniert der BI, nur er legt nicht mehrere Erfassungsblätter hintereinander an. Dann kommt die Meldung Benutzer x/y bearbeitet bereits Bestellung x/y und es wird nur die erste Position angelegt.

Davor habe ich bereits den Baustein BAPI_ENTRYSHEET_CREATE getestet, dieser hat aber nicht das gewünschte erfüllt.

Hier der Programmausschnitt für den BI:

IF p_echtl = 'X'. 
PERFORM open_group USING '01MM_MI02' P_ct.
ENDIF.
LOOP AT gt_loop INTO gs_loop.
CALL METHOD zcl_bc_tools=>schraffur.
WRITE: / gs_loop-EBELN,
gs_loop-EBELP.
CALL METHOD zcl_bc_tools=>auffuellen.
IF p_echtl = 'X'.
PERFORM anlegen USING gs_loop-ebeln
gs_loop-EBELp.
ENDIF.
ENDLOOP.
IF p_echtl = 'X'.
PERFORM close_group USING p_ct.
ENDIF.
------------------------ Batch-Input---------------------------------
FORM anlegen USING i_ebeln
i_ebelp.
if sy-subrc <> 0. exit. endif.
perform bdc_dynpro using 'SAPLMLSR' '0400'.
perform bdc_field using 'BDC_OKCODE'
'=SELP'.
perform bdc_field using 'BDC_CURSOR'
'RM11P-NEW_ROW'.
perform bdc_field using 'RM11P-NEW_ROW'
'10'.
perform bdc_dynpro using 'SAPLMLSR' '0340'.
perform bdc_field using 'BDC_CURSOR'
'RM11R-EBELP'.
perform bdc_field using 'BDC_OKCODE'
'=ENTE'.
perform bdc_field using 'RM11R-EBELN'
i_ebeln.
perform bdc_field using 'RM11R-EBELP'
i_ebelp.
perform bdc_dynpro using 'SAPLMLSR' '0400'.
perform bdc_field using 'BDC_OKCODE'
'=NEU'.
perform bdc_field using 'BDC_CURSOR'
'RM11P-NEW_ROW'.
perform bdc_field using 'RM11P-NEW_ROW'
'10'.
perform bdc_dynpro using 'SAPLMLSR' '0400'.
perform bdc_field using 'BDC_CURSOR'
'ESSR-TXZ01'.
perform bdc_field using 'BDC_OKCODE'
'=VOKO'.
perform bdc_field using 'ESSR-LBLDT'
date_LBLDT.
perform bdc_field using 'ESSR-BLDAT'
date_bldat.
perform bdc_field using 'ESSR-BUDAT'
date_budat.
perform bdc_field using 'RM11P-NEW_ROW'
'10'.
perform bdc_dynpro using 'SAPLMLSP' '0500'.
perform bdc_field using 'BDC_CURSOR'
'RM11P-MUSTER_LV'.
perform bdc_field using 'BDC_OKCODE'
'=OK'.
perform bdc_field using '*RM11P-BEST_SEL'
'X'.
perform bdc_dynpro using 'SAPLMLSP' '0201'.
perform bdc_field using 'BDC_OKCODE'
'=GRPD'.
perform bdc_field using 'BDC_CURSOR'
'ESLL-KTEXT1(01)'.
perform bdc_field using 'RM11P-NEW_ROW'
'10'.
perform bdc_dynpro using 'SAPLMLSK' '0200'.
perform bdc_field using 'BDC_CURSOR'
'RM11K-MKNTM(01)'.
perform bdc_field using 'BDC_OKCODE'
'/00'.
perform bdc_field using 'VRTKZ1'
'X'.
perform bdc_dynpro using 'SAPLMLSK' '0200'.
perform bdc_field using 'BDC_CURSOR'
'RM11K-MKNTM(01)'.
perform bdc_field using 'BDC_OKCODE'
'=UMOD'.
perform bdc_field using 'VRTKZ1'
'X'.
perform bdc_dynpro using 'SAPLMLSK' '0100'.
perform bdc_field using 'BDC_CURSOR'
'ESKN-SAKTO'.
perform bdc_field using 'BDC_OKCODE'
'=ENTE'.
*perform bdc_field using 'ESKN-SAKTO'
* record-SAKTO_013.
*perform bdc_field using 'DKACB-FMORE'
* record-FMORE_014.
perform bdc_dynpro using 'SAPLKACB' '0002'.
perform bdc_field using 'BDC_CURSOR'
'COBL-AUFNR'.
perform bdc_field using 'BDC_OKCODE'
'=ENTE'.
*perform bdc_field using 'COBL-AUFNR'
* record-AUFNR_015.
perform bdc_dynpro using 'SAPLMLSR' '0400'.
perform bdc_field using 'BDC_CURSOR'
'ESSR-TXZ01'.
perform bdc_field using 'BDC_OKCODE'
'=ACCP'.
perform bdc_field using 'ESSR-BLDAT'
date_bldat.
perform bdc_field using 'ESSR-BUDAT'
date_budat.
perform bdc_field using 'RM11P-NEW_ROW'
'10'.
perform bdc_dynpro using 'SAPLMLSR' '0400'.
perform bdc_field using 'BDC_OKCODE'
'=SAVE'.
perform bdc_field using 'BDC_CURSOR'
'RM11P-NEW_ROW'.
perform bdc_field using 'RM11P-NEW_ROW'
'10'.
perform bdc_dynpro using 'SAPLSPO1' '0300'.
perform bdc_field using 'BDC_OKCODE'
'=YES'.
perform bdc_transaction using 'ML81N' p_ct 'MZ_T02'.
ENDFORM.
4 REPLIES 4

raymond_giuseppi
Active Contributor
456

Read OSS notes such as 381805 - ML81N: Batch input is not possible and Business Object BUS2091 method Create, implemented

What exactly was the problem with the BAPI?

0 Kudos
456

I already solved the problem, the time in between creating two entrysheets was too short. Because of that it was blocked.

But thanks anyways!

456

Then please close your question

Sandra_Rossi
Active Contributor
0 Kudos
456

Bitte bearbeiten Sie Ihre Frage, wählen Sie Ihren Code aus und drücken Sie die Schaltfläche [CODE], wodurch der Code farbig/eingerückt erscheint, damit die Leute ihn leichter sehen können. Danke dir!