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

Problem in creating BDC program for FI TCODEs

Former Member
0 Likes
4,209

Hi experts,

I am trying to create a BDC program for the finance TCODES: ( FIAPSA_PYMO01, FIAPSA_EXPO ) but I face a problem that I cannot move page down in the control table in the screen even I can't move down in down key. Moreover, I have not found any BAPI function does the functionality of the screen. Can anyone help me.

Is there any way to upload data in batch rather than BDC or BAPI?

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
4,178

Try an entirely different approach: I don't see these transactions, so I cannot test.

But in many screens, there is something like a "position" button that allows you to bring any item to the top of the screen. If a button like this exists in these transactions, you can use it instead of page down.

Rob

21 REPLIES 21
Read only

Former Member
0 Likes
4,178

Hi Abdel,

First you need find what`s the function code of 'Page down', you can go into related tcode, typing '/H' in command line, then click 'Page down' button, in debugging mode, you will see what function code exactly it is.

Then in your BDC snippet code,

perform bdc_field         using 'BDC_OKCODE'      '=P+'.   "if function code is '=P+'.


regards,

Archer

Read only

0 Likes
4,178

Thanks Mr. Dengyong for replaying.

actually I tried P+ ,P++,DOWN and /00 but with no luck.

in the recording the down showed as /00 but if I run the recording it does not go down.

Read only

0 Likes
4,178

Hi Abder ,

With this code

perform bdc_field         using 'BDC_OKCODE'      '=P+'.   "if function code is '=P+'.


you have to put a condition that after how many lines you want to scroll down.

One more important thing :

Please use CTU_params- Defsize eq 'X'.

What it will do : It will set the same no of displayed lines in the table control for all users.

If you dont use this, the no of lines displayed  in the table control may differ user to user .

Regards

Akshat

Read only

0 Likes
4,178

You need to create two recording.

1st you have to check how may entry fill without down key press. for exp. X entry

In program calculate total entry. (Y)

if Y entry are less or equal to X then go to normal recoding .

else go to down key press recording.

Regards,

Sandeep

Read only

0 Likes
4,178

Thanks Mr. Aksht for replaying.

actually I did put my code in loop to move to the next page once all lines are filled. but specially for these TCODEs it does not work. I did it for many TCODEs for example MIGO and the pagination is working fine.

these TCODES specially I have no idea why it is behave like this.

thank you for sharing the idea of fixing no of lines for all users.

Read only

0 Likes
4,178

Dear Mr. Sandeep the problem is in the normal entry you can go down with down-key and the BDC-code will be /00. But when I perform the batch running with BDC-CODE = /00 or P++ OR P+ it does not go down or page down.

Read only

0 Likes
4,178

you need to put condition.

if normal entry then down-key related code not execute and other case it should be execute.

Read only

0 Likes
4,178

no you did not get my point. sorry.

I mean when you access the standard transaction FIAPSA_EXPO and start entering data and move down the cursor is moving down and create a new record.

But if I run the program which has the code of recording it does not move down.

Read only

0 Likes
4,178

Hi Abdel,

It difficult to understand the exact issue, But while table control please check the cursor position where your cursor is placing. In some transaction that issue might happen please check in your case also.


When you press p++ put the cursor position at the end of the table control Field name.

Suppose you are at line 9. perform the OK CODE '++P' or whatever is it after placing the  Field VK01-BUKRS(09).

and Try it.

Thanks and Regards,

Read only

0 Likes
4,178

Thanks a lot Nishant,

I try to go to the last field in the control table in the screen and it goes down and creating a new record but in recording it gives me the bdc_code /00 and same behavior it does not create a new record in the program.

Read only

0 Likes
4,178

Hi,

Abdel can you please do one favour,

Paste a screen shot of your TABLE Control ,

Download the BDCDATA internal table data in debugging mode, attach the code.

Than i think we will give you better solution.

Thanks
Nishant

Read only

0 Likes
4,178

Please find the attached files:

Read only

0 Likes
4,178

Here is the excel file need to uploud

Read only

0 Likes
4,178

Hi Abdel,

There is an issue with your code.

In BDC table you have to do  manually coding.

Your code is working for only 3 items not more than 3 items.

I will give you one example.

One thing i would like to tell you always select DEFAULT Screen Checkbox while doing the BDC Recording.

Suppose your table control contains 3 lines.

     1.    First items field become FIAPSA _S_ORDER_LT-wrbtr(01).

     2.     Second item field become  FIAPSA _S_ORDER_LT-wrbtr(02).

     3.      Second item field become   FIAPSA _S_ORDER_LT-wrbtr(03)

again if you press p++ then the 4 line that is not shown in the screen by default.

the fourth lines becomes 1st line.

Your code becomes like this

data lv_char type char2

loop at itab.

lv_Count = lv_count + 1.


     FIAPSA _S_ORDER_LT-wrbtr(lv_count).


if lv_count = 3.

clear lv_Count.

endif.


endloop

Do one thing send me one test mail on my ID. I will send you some sample code.

<private information removed by moderator>

Thanks and Regards,

Nishant

Message was edited by: Manish Kumar

Read only

0 Likes
4,178

Thanks Mr. Nishant,

Maybe this code is the latest change I have made. but for first scenario I have done I was making inside the loop an if statment to check if the counter reach max no record in the screen to reset the counter into second row like this:

DATA COUNTER TYPE N LENGTH 2.


loop at it_data INTO RECORD where BELNR_000 = H_RECORD-BELNR_000.

COUNTER = COUNTER + 1.

perform bdc_field       using 'BDC_CURSOR'

                               'FIAPSA_S_ORDR_LT-WRBTR(03)'.

perform bdc_field       using 'BDC_OKCODE'

                               '/00'.

perform bdc_dynpro      using 'SAPMFIAPSA_EXPO' '2001'.


CONCATENATE 'FIAPSA_S_ORDR_LT-SAKNR(' COUNTER ')' INTO TEMP.

perform bdc_field       using TEMP   record-SAKNR_01_013.

perform bdc_dynpro      using 'SAPMFIAPSA_EXPO' '2001'.

perform bdc_field       using 'BDC_CURSOR'

                               'FIAPSA_S_ORDR_LT-WRBTR(03)'.

perform bdc_field       using 'BDC_OKCODE'

                               '/00'.

IF COUNTER = NO_DISPLAYED_RECORD_IN_SCREEN.

perform bdc_dynpro      using 'SAPMFIAPSA_EXPO' '2001'.

perform bdc_field       using 'BDC_CURSOR'

                               'FIAPSA_S_ORDR_LT-WRBTR(03)'.

perform bdc_field       using 'BDC_OKCODE'

                               '=P+'.

CLEAR COUNTER.

ENDIF.

endloop.


Please check your email I send an email.

Read only

0 Likes
4,178

in the prior code I want to mention that I tried for pagination bdc_code different things:

p++

p+

=p+

down

/00

Read only

0 Likes
4,178

Hi,

For Pagination do one thing,

Go to actual Transaction, press /H in the command field.

then press Page down option.

then it will go to Debugging mode after that check the value of SY-UCOMM.


There is also some cases where we need to check if press enter that time also it will jump into next line, but good practice as per my personal experience is use Standard one.


Thanks and Regards,

Nishant

Read only

0 Likes
4,178

the SY-UCOMM = 'DOWN'

but when I change it in the code it behaves the same.

Read only

Former Member
0 Likes
4,179

Try an entirely different approach: I don't see these transactions, so I cannot test.

But in many screens, there is something like a "position" button that allows you to bring any item to the top of the screen. If a button like this exists in these transactions, you can use it instead of page down.

Rob

Read only

0 Likes
4,178

there is no such button

Read only

0 Likes
4,178

The problem has been solved by applying the following notes:

2161962

2171836

2130971

2172216

2179042

I will represent the problem again in different words:

TCODE FIAPSA_EXPO:

When we create a recording in TCODE: SHDB, in the control table when I

am trying to create a new line by pressing down key or reaching last

field in the table record and press Tab key, the new line is created

and I get function code '/00'.

The problem:

When we creating an executable program to upload the data into the

screen and running the code:

perform bdc_field using 'BDC_OKCODE' '/00' ."'=P+'."'=DOWNN'.

It does not create a new line in the control table.

I tried =P+, P+ ,P++,DOWN and /00 as function codes to create a new

line but with no luck.

TCODE FIAPSA_PYMO01:

The problem in Payment Order screen is divided into two parts:

Part I:

When you reach the table FIAPSA_S_PYMO in the program "SAPMFIAPSA_PYMO"

screen 1000 you cannot programmatically select the required rows by the

below code:

perform bdc_dynpro using 'SAPMFIAPSA_PYMO' '1000'.

perform bdc_field using 'BDC_CURSOR'

'FIAPSA_S_PYMO-EXPNO(01)'.

perform bdc_field using 'BDC_OKCODE'

'=CREATE'.

DO V_NUMBER_0DIG TIMES.

CONCATENATE 'ROW(' V_COUNTER ')' INTO ROW_NUMBER.

perform bdc_field using ROW_NUMBER 'X'.

ENDDO.

Even we tried to test and write it directly:

perform bdc_field using 'ROW(01)' 'X'.

The message which showed up is :

Field ROW (1) does not exist in the screen SAPMFIAPSA_PYMO 1000.

Part II:

When you reach the control table FIAPSA_S_PYMO in the screen 2000 in

the program "SAPMFIAPSA_PYMO" we cannot scroll down to fill the cells

for all records because the visible table shown only 5 records even if

I tried the BDC_OKCODE =P++, =P+.

So, if we have 10 records in the control table I can only modify the

amount for the first 5 records only and I cannot scroll down to the

rest 5 records to modify them.