Application Development 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: 

Reading screen fields during batch input

Former Member
0 Kudos

I am trying to write a batch upload program using the transaction FB50 and one of the screens, SAPMF05A, displays multiple lines of different tax amounts which I need to populate based on the displayed tax codes.

Have been trying to use FM DYNP_VALUES_READ to read the values of the screen fields but never succeeded in getting any proper return values, L_VALUE. Below is the code block, what am I doing wrong?

MOVE VI_ROW_COUNT TO VC_ROWNUM.

L_LNO = STRLEN( VC_ROWNUM ).

IF L_LNO <= 1.

CONCATENATE '0' VC_ROWNUM INTO VC_ROWNUM.

ENDIF.

CONCATENATE 'BSET-MWSKZ(' VC_ROWNUM ')' INTO L_FLD.

CONDENSE L_FLD NO-GAPS.

T_DF-FIELDNAME = L_FLD.

APPEND T_DF.

L_REPID = SY-REPID.

L_SCRNR = SY-DYNNR.

CALL FUNCTION 'DYNP_VALUES_READ'

EXPORTING

dyname = L_REPID

dynumb = L_SCRNR

TABLES

dynpfields = T_DF

EXCEPTIONS

invalid_abapworkarea = 1

invalid_dynprofield = 2

invalid_dynproname = 3

invalid_dynpronummer = 4

invalid_request = 5

no_fielddescription = 6

invalid_parameter = 7

undefind_error = 8

double_conversion = 9

stepl_not_found = 10

OTHERS = 11.

READ TABLE T_DF WITH KEY FIELDNAME = L_FLD transporting FIELDVALUE.

IF SY-SUBRC EQ 0.

L_VALUE = T_DF-FIELDVALUE.

ELSE.

L_VALUE = '999'.

ENDIF.

1 ACCEPTED SOLUTION

ferry_lianto
Active Contributor
0 Kudos

Hi Goh,

Welcome to SDN.

FB50 is SAP enjoy transaction and this type of transaction is not suitable for BDC.

You should use a standard program <b>RFBIBL00</b> or create a BDC program for FB01 transaction instead of FB50.

Other alternative is using the following BAPI.

BAPI_ACC_DOCUMENT_POST

BAPI_ACC_GL_POSTING_POST

Hope this will help.

Regards,

Ferry Lianto

3 REPLIES 3

ferry_lianto
Active Contributor
0 Kudos

Hi Goh,

Welcome to SDN.

FB50 is SAP enjoy transaction and this type of transaction is not suitable for BDC.

You should use a standard program <b>RFBIBL00</b> or create a BDC program for FB01 transaction instead of FB50.

Other alternative is using the following BAPI.

BAPI_ACC_DOCUMENT_POST

BAPI_ACC_GL_POSTING_POST

Hope this will help.

Regards,

Ferry Lianto

0 Kudos

Hi Ferry,

Will explore the alternatives suggested. Thanks for the reply.

RichHeilman
Developer Advocate
Developer Advocate
0 Kudos

Also, it is not possible to "read" values from the screen during BDC processing. You must know what the value is before execution of the BDC and handle it accordingly in your recording. As suggested, it is better to do BAPI anyway.

Regards,

Rich Heilman