‎2006 Mar 31 7:22 AM
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.
‎2006 Mar 31 7:35 AM
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
‎2006 Mar 31 7:35 AM
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
‎2006 Apr 03 2:05 AM
Hi Ferry,
Will explore the alternatives suggested. Thanks for the reply.
‎2006 Apr 03 2:47 AM