Application Development and Automation 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: 
Read only

Batch input in FM.

Former Member
0 Likes
1,159

Hi all,

Can any body say how to write a function module using batch input calltransaction.

plzzz urgent.

regards.

4 REPLIES 4
Read only

Former Member
0 Likes
867

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

Read only

0 Likes
867

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.

Read only

0 Likes
867

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,.

Read only

former_member404244
Active Contributor
0 Likes
867

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