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 with transaction 9KE0

Former Member
0 Likes
559

Hi all,

I want to send the data of an itab into system via batch input of trans 9KE0 but there is a trick that I never met:

Recording is like that:

BDC_CURSOR Z-BDC08(03)

BDC_OKCODE /00

Z-BDC02(03) 980000

Z-BDC04(03) 599455

Z-BDC08(03) -1655450

BDC_CURSOR Z-BDC08(04)

BDC_OKCODE /00

Z-BDC02(04) 980000

Z-BDC04(04) 599453

Z-BDC08(04) -1551205,50

That is a table control is used and the rows are counted as Z-BDC02(04) etc but I do not know the number of itab rows.

Even if I know how can I code such a thing?

For every row do I have to code it?

Urgent and useful answers will be rewarded.

Thanks.

deniz

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
431

Hi,

Refer the code below for tcode MP01.It has table control.

mytabix = 0 .

mytabix = mytabix + 1.

LOOP AT it_file1 INTO wa_file1 where bmatn = zbmatn.

IF wa_file1-bmatn = space.

index = mytabix.

n = index.

condense n no-gaps.

CONCATENATE 'VAMPL-EMATN(0' n ')' INTO tran.

PERFORM bdc_field USING tran wa_file1-ematn.

CLEAR tran.

CONCATENATE 'VAMPL-MFRNR(0' n ')' INTO tran.

PERFORM bdc_field USING tran wa_file1-mfrnr.

CLEAR tran.

CONCATENATE 'VAMPL-WERKS(0' n ')' INTO tran.

PERFORM bdc_field USING tran wa_file1-werks.

CLEAR tran.

CONCATENATE 'VAMPL-DATUV(0' n ')' INTO tran.

PERFORM bdc_field USING tran wa_file1-datuv.

CLEAR tran.

CONCATENATE 'VAMPL-DATUB(0' n ')' INTO tran.

PERFORM bdc_field USING tran wa_file1-datub.

CLEAR tran.

CONCATENATE 'VAMPL-REVLV(0' n ')' INTO tran.

PERFORM bdc_field USING tran wa_file1-revlv.

CLEAR tran.

CONCATENATE 'VAMPL-AMPSP(0' n ')' INTO tran.

PERFORM bdc_field USING tran wa_file1-ampsp.

CLEAR tran.

mytabix = mytabix + 1.

CLEAR wa_file1.

ENDLOOP.

Hi all,

I want to send the data of an itab into system via batch input of trans 9KE0 but there is a trick that I never met:

Recording is like that:

BDC_CURSOR Z-BDC08(03)

BDC_OKCODE /00

Z-BDC02(03) 980000

Z-BDC04(03) 599455

Z-BDC08(03) -1655450

BDC_CURSOR Z-BDC08(04)

BDC_OKCODE /00

Z-BDC02(04) 980000

Z-BDC04(04) 599453

Z-BDC08(04) -1551205,50

That is a table control is used and the rows are counted as Z-BDC02(04) etc but I do not know the number of itab rows.

Even if I know how can I code such a thing?

For every row do I have to code it?

Urgent and useful answers will be rewarded.

Thanks.

deniz

1 REPLY 1
Read only

Former Member
0 Likes
432

Hi,

Refer the code below for tcode MP01.It has table control.

mytabix = 0 .

mytabix = mytabix + 1.

LOOP AT it_file1 INTO wa_file1 where bmatn = zbmatn.

IF wa_file1-bmatn = space.

index = mytabix.

n = index.

condense n no-gaps.

CONCATENATE 'VAMPL-EMATN(0' n ')' INTO tran.

PERFORM bdc_field USING tran wa_file1-ematn.

CLEAR tran.

CONCATENATE 'VAMPL-MFRNR(0' n ')' INTO tran.

PERFORM bdc_field USING tran wa_file1-mfrnr.

CLEAR tran.

CONCATENATE 'VAMPL-WERKS(0' n ')' INTO tran.

PERFORM bdc_field USING tran wa_file1-werks.

CLEAR tran.

CONCATENATE 'VAMPL-DATUV(0' n ')' INTO tran.

PERFORM bdc_field USING tran wa_file1-datuv.

CLEAR tran.

CONCATENATE 'VAMPL-DATUB(0' n ')' INTO tran.

PERFORM bdc_field USING tran wa_file1-datub.

CLEAR tran.

CONCATENATE 'VAMPL-REVLV(0' n ')' INTO tran.

PERFORM bdc_field USING tran wa_file1-revlv.

CLEAR tran.

CONCATENATE 'VAMPL-AMPSP(0' n ')' INTO tran.

PERFORM bdc_field USING tran wa_file1-ampsp.

CLEAR tran.

mytabix = mytabix + 1.

CLEAR wa_file1.

ENDLOOP.