‎2007 Oct 15 6:40 AM
Hi all,
Can any body say how to write a function module using batch input calltransaction.
plzzz urgent.
regards.
‎2007 Oct 15 6:42 AM
Hi,
You record teh transaction using SHDB.
And then in the SHDB txn,
Menu Edit-> Create Function Module
To create a function module out of recording for the transaction used.
Reward if helpful.
RSS
‎2007 Oct 15 7:03 AM
hi,
thanks for ur answer
but how to mention my input file
i can't write gui upload there right
so how i have to pass my input file..
plzz suggest me as early as possible.
‎2007 Oct 25 9:08 AM
Hi,
You have to read the file using 'GUI_UPLOAD' and process it in Internal Table. And then loop through the internal table and within the loop, you call teh generated function module which will execute the transaction with your file date.
Hope this solves your problem.
Reward if helpful.
RSS,.
‎2007 Oct 15 6:55 AM
Hi,
check the below code...
FUNCTION ZW_CLEAR.
*"----
""Local interface:
*" IMPORTING
*" VALUE(CTU) LIKE APQI-PUTACTIVE DEFAULT 'X'
*" VALUE(MODE) LIKE APQI-PUTACTIVE DEFAULT 'N'
*" VALUE(UPDATE) LIKE APQI-PUTACTIVE DEFAULT 'L'
*" VALUE(GROUP) LIKE APQI-GROUPID OPTIONAL
*" VALUE(USER) LIKE APQI-USERID OPTIONAL
*" VALUE(KEEP) LIKE APQI-QERASE OPTIONAL
*" VALUE(HOLDDATE) LIKE APQI-STARTDATE OPTIONAL
*" VALUE(NODATA) LIKE APQI-PUTACTIVE DEFAULT '/'
*" VALUE(LGNUM_001) LIKE BDCDATA-FVAL DEFAULT '888'
*" VALUE(IVNUM_002) LIKE BDCDATA-FVAL DEFAULT '143'
*" VALUE(DUNKL_003) LIKE BDCDATA-FVAL DEFAULT 'H'
*" EXPORTING
*" VALUE(SUBRC) LIKE SYST-SUBRC
*" TABLES
*" MESSTAB STRUCTURE BDCMSGCOLL OPTIONAL
*"----
subrc = 0.
perform bdc_nodata using NODATA.
perform open_group using GROUP USER KEEP HOLDDATE CTU.
perform bdc_dynpro using 'SAPML04I' '0222'.
perform bdc_field using 'BDC_CURSOR'
'LINV-IVNUM'.
perform bdc_field using 'BDC_OKCODE'
'/00'.
perform bdc_field using 'LINV-LGNUM'
LGNUM_001.
perform bdc_field using 'LINV-IVNUM'
IVNUM_002.
perform bdc_field using 'RL04I-DUNKL'
DUNKL_003.
perform bdc_dynpro using 'SAPMSSY0' '0120'.
perform bdc_field using 'BDC_CURSOR'
'07/03'.
*{ REPLACE S20K900243 1
*\perform bdc_field using 'BDC_OKCODE'
*\ '=MRKA'.
perform bdc_field using 'BDC_OKCODE'
'=&ALL'.
*} REPLACE
perform bdc_dynpro using 'SAPMSSY0' '0120'.
perform bdc_field using 'BDC_CURSOR'
'07/03'.
perform bdc_field using 'BDC_OKCODE'
'=DIAU'.
perform bdc_transaction tables messtab
using 'LI20'
CTU
MODE
UPDATE.
if sy-subrc <> 0.
subrc = sy-subrc.
exit.
endif.
perform close_group using CTU.
ENDFUNCTION.
reward if helpful..
Regards,
Nagaraj