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

f-04 bdc problem

Former Member
0 Likes
1,003

HI

FRIENDS STUCK IN A SMALL PROBLEM IAM DOING A BDC FOR F-04

IN WHICH I HAD FLAT FILE IN THE FOLLOWING FORMAT ,

27.10.2004 sa npil 31.07.2006 3689525.64 1000 2000 2810200 7400007174

7400007175

7400007176

27.10.2004 sa npil 31.07.2006 3689525.64 1001 2000 2810200 7400007177

7400007178

7400007179

THE DATA IS SPLIT DEPENDING UPON BUSINESS AREA 1000 AND 1001 , BUT IAM NOT ABLE TO GET ALL THE

ACCOUNT NOS STARTING FROM 7400 .. TO NEXT BUSINESS AREA I AM GETTING ONLY THE FIRST ACCT NO.

HERE I THINK AT NEW IS NOT WORKING .

SO PLS CAN ANYBODY TELL ME HOW TO DO THIS .

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
858

Hi Farukh,

The Flat File must be in Header( 27.10.2004 sa npil 31.07.2006 3689525.64 1000 2000 2810200 7400007174 )

and Item( 7400007175 ) format for such requirements.

In Header & Item you can have one extra field ( say <b>RELN</b> )to relate between them.

<b>Header</b>

<b>1000</b> 27.10.2004 sa npil 31.07.2006 3689525.64 1000 2000 2810200 7400007174

<b>1001</b> 27.10.2004 sa npil 31.07.2006 3689525.64 1001 2000 2810200 7400007177

<b>Item</b>

<b>1000</b> 7400007175
<b>1000</b> 7400007176
<b>1001</b> 7400007178
<b>1001</b> 7400007179

Then in the Program.


loop at it_header .

"Header level BDC data

loop at it_item where <b>RELN = it_header-RELN</b>.

"Will get Item level BDC data based on header

endloop.

endloop.

Regards,

AS

7 REPLIES 7
Read only

naimesh_patel
Active Contributor
0 Likes
858

Hello,

Fill one more table with the business area and GL. and do the loop on that whenever you required to pass the data. And read your original file accordinly.

regards,

Naimesh

Read only

abdul_hakim
Active Contributor
0 Likes
858

hi,

you should have data in the format in which you are validating.

this will ease your batch data transfer process.

you could have the records starting with business area as the field.

Also keep in mind that there should be an indicator to distinguish between header and item records

For eg,you could have H to indicate the header and I to indicate the item..

Cheers,

Abdul Hakim

Read only

Former Member
0 Likes
859

Hi Farukh,

The Flat File must be in Header( 27.10.2004 sa npil 31.07.2006 3689525.64 1000 2000 2810200 7400007174 )

and Item( 7400007175 ) format for such requirements.

In Header & Item you can have one extra field ( say <b>RELN</b> )to relate between them.

<b>Header</b>

<b>1000</b> 27.10.2004 sa npil 31.07.2006 3689525.64 1000 2000 2810200 7400007174

<b>1001</b> 27.10.2004 sa npil 31.07.2006 3689525.64 1001 2000 2810200 7400007177

<b>Item</b>

<b>1000</b> 7400007175
<b>1000</b> 7400007176
<b>1001</b> 7400007178
<b>1001</b> 7400007179

Then in the Program.


loop at it_header .

"Header level BDC data

loop at it_item where <b>RELN = it_header-RELN</b>.

"Will get Item level BDC data based on header

endloop.

endloop.

Regards,

AS

Read only

0 Likes
858

hi

thanks for reply .

i did in the same way as u experts gaveme the suggestion

but its only picking up the data of only one business area for ex. working fine for the records of first business area in file and at the second busineess area

the header table gets blank , but it has all the data in begining ? why?.didnt find anything in debugging.

regards .

Read only

0 Likes
858

Hello,

Your itab is like

27.10.2004 sa npil 31.07.2006 3689525.64 1000 2000 2810200 7400007174

7400007175

7400007176

27.10.2004 sa npil 31.07.2006 3689525.64 1001 2000 2810200 7400007177

7400007178

7400007179

make it is as

X 27.10.2004 sa npil 31.07.2006 3689525.64 1000 2000 2810200 7400007174

27.10.2004 sa npil 31.07.2006 3689525.64 1000 2000 2810200 7400007175

27.10.2004 sa npil 31.07.2006 3689525.64 1000 2000 2810200 7400007176

X 27.10.2004 sa npil 31.07.2006 3689525.64 1001 2000 2810200 7400007177

27.10.2004 sa npil 31.07.2006 3689525.64 1001 2000 2810200 7400007178

27.10.2004 sa npil 31.07.2006 3689525.64 1001 2000 2810200 7400007179

If first column is 'X' then do processing of the header value.

Regards,

Naimesh

Read only

0 Likes
858

This is the code ,

LOOP AT i_final .

CLEAR i_gsber.

MOVE-CORRESPONDING i_final TO i_gsber.

APPEND i_gsber.

ENDLOOP.

LOOP AT i_gsber.

CLEAR item.

    • MOVE-CORRESPONDING i_gsber TO item.

IF i_gsber-gsber <> space .

w_gsber = i_gsber-gsber.

ENDIF.

item-gsber = w_gsber.

item-sel01 = i_gsber-sel01.

APPEND item.

ENDLOOP.

*

*********************the include part

PERFORM bdc_dynpro USING 'SAPMF05A' '0731'.

PERFORM bdc_field USING 'BDC_OKCODE'

'/00'.

LOOP AT item WHERE gsber = wa_itab-gsber.

MOVE-CORRESPONDING item TO wa_item.

  • ENDAT.

  • LOOP AT item WHERE gsber = i_gsber-gsber.

w_count = w_count + 1.

CONCATENATE 'RF05A-SEL01(' w_count ')' INTO w_bdc.

PERFORM bdc_field USING w_bdc

wa_item-sel01.

IF w_count >= 16.

w_count = 0.

PERFORM bdc_dynpro USING 'SAPMF05A' '0731'.

PERFORM bdc_field USING 'BDC_OKCODE'

'/00'.

ENDIF.

ENDLOOP.

  • AT END OF gsber.

PERFORM bdc_dynpro USING 'SAPMF05A' '0731'.

PERFORM bdc_field USING 'BDC_OKCODE'

'=PA'.

PERFORM bdc_dynpro USING 'SAPDF05X' '3100'.

PERFORM bdc_field USING 'BDC_OKCODE'

'=AB'.

PERFORM bdc_dynpro USING 'SAPMF05A' '0700'.

PERFORM bdc_field USING 'BDC_OKCODE'

'=BU'.

regards

Read only

Former Member
0 Likes
858

hi ..any body