‎2009 Nov 20 12:10 PM
I am using RFC_READ_TABLE to access table BSEG on a remote system. My problem is retrieving field PSWBT which is a currency field. The value is returned as 20202020203.43 and overwrites part of the next field too. The value should be 4,083.33
Does anyone have any experence with currency fields in this situation and can offer any advice?
Thanks & regards.
‎2009 Nov 20 1:02 PM
Check if this helps: [Getting around RFC_READ_TABLE limitations|http://searchsap.techtarget.com/tip/0,289483,sid21_gci997032,00.html]
‎2009 Nov 22 11:48 AM
Hello,
Did you also use the internal table FIELDS from RFC_READ_TABLE ?
I did a small test with fields PSWBT and PSWSL with success.
I included the PSWSL currency field for proper formatting of the PSWBT value with a WRITE statement.
To calculate the off sets in table FIELDS I used SE11 for table BSEG.
Structure and fields can also be found in table DD03L.
FIELDNAME OFFSET LENGTH T
PSWBT 000000 000013 P
PSWSL 000014 000005 C
Success.
Wim
‎2009 Nov 24 2:41 PM
Hi everyone,
Thank you for your help. I have now resolved the issue.
Yes I was using table FIELDS. Wim was correct that I also needed to use field PSWSL but this alone did not solve the problem. I had to define the currency field PSWBT as char 13. When the field was retrieved using RFC_READ_TABLE, I condensed the field and then moved it back to a currency field. As follows:
TYPES : BEGIN OF ty_accdoc,
pswbt(13),
pswsl type pswsl,
END OF ty_accdoc.
DATA : wa_accdoc TYPE ty_accdoc,
i_accdoc TYPE TABLE OF ty_accdoc.
DATA : wa-pswbt TYPE pswbt.
wa_fields-fieldname = 'PSWBT'. APPEND wa_fields TO i_fields.
wa_fields-fieldname = 'PSWSL'. APPEND wa_fields TO i_fields.
u2026u2026u2026 Call function u2018RFC_READ_TABLEu2019u2026u2026u2026u2026
CONDENSE wa_accdoc-pswbt NO-GAPS.
wa-pswbt = wa_accdoc2-pswbt.
Kind regards,
Alison