‎2006 Sep 29 2:11 PM
Hi,
I have written a BDC program for transaction code MB1B. The program will search the table MARD for plants PRD1 and PRD2. The data is stored in an internal table. All the stocks in PRD1 and PRD2 are then transferred to other plants based on some logic.
The problem is that it runs absolutely fine in MODE 'A', however when I run it in background it gives an error -"No batch input data for screen SAPLKACB 0002". This screen does not display when we are recording the transaction MB1B in SHDB. Any idea why this error is occuring.
I have recorded the transaction in client 200 - Development Client. The program is running in Client 220 - Test as there is no data in the client 200 to test it.
‎2006 Sep 29 2:20 PM
Hi,
Generally in BDC you should be able to see the small box which displays the ok code. If it doesnot appear automatically for even a single screen in mode 'A' that means there is a problem with your recording.
Also some screen will look different in BDC ( for example XD02 ).The comparison has to be made during recording.
Regards,
Sathish
Note: Please reward useful answer.
‎2006 Sep 29 2:22 PM
try the recording in client 220 and see if the screen appears as some times the config may be different or the depending on data there might be dynamic screens.
‎2006 Sep 29 2:22 PM
Use the BAPI instead, it will save you from such headaches. Here is an example. You will need to modify for you particular requirement, I assume you are using movement type 301?
report zrich_0001.
* Structures for BAPI
data: gm_header type bapi2017_gm_head_01.
data: gm_code type bapi2017_gm_code.
data: gm_headret type bapi2017_gm_head_ret.
data: gm_item type table of
bapi2017_gm_item_create with header line.
data: gm_return type bapiret2 occurs 0 with header line.
data: gm_retmtd type bapi2017_gm_head_ret-mat_doc.
clear: gm_return, gm_retmtd. refresh gm_return.
* Setup BAPI header data.
gm_header-pstng_date = sy-datum.
gm_header-doc_date = sy-datum.
gm_code-gm_code = '06'. " MB11
* Write 971 movement to table
clear gm_item.
move '971' to gm_item-move_type .
move '000000000040000100' to gm_item-material.
move '1' to gm_item-entry_qnt.
move 'EA' to gm_item-entry_uom.
move '0004' to gm_item-plant.
move '4999' to gm_item-stge_loc.
move '0901' to gm_item-move_reas.
append gm_item.
* Call goods movement BAPI
call function 'BAPI_GOODSMVT_CREATE'
exporting
goodsmvt_header = gm_header
goodsmvt_code = gm_code
importing
goodsmvt_headret = gm_headret
materialdocument = gm_retmtd
tables
goodsmvt_item = gm_item
return = gm_return.
if not gm_retmtd is initial.
commit work and wait.
call function 'DEQUEUE_ALL'.
else.
commit work and wait.
call function 'DEQUEUE_ALL'.
endif.
write:/ gm_retmtd.
loop at gm_return.
write:/ gm_return.
endloop.
Regards,
Rich Heilman
‎2006 Sep 29 2:32 PM