Skip to Content

Archived discussions are read-only. Learn more about SAP Q&A

Feild Symbol Currency Feild Issue

Hi Experts,

I am facing some problem with the currency feild. When I try to pass the curreny feild to the feild symbol it it not assignning.

Here is the scenarion.

FIELD-SYMBOLS: <fs>.

LOOP AT it_final1 INTO wa_final1.

ASSIGN COMPONENT 'AMT' OF STRUCTURE <wa_final2> TO <fs>.

IF sy-subrc = 0.

<fs> = wa_final1-wkgbtr.

ENDIF.

endloop.

when i pass wa_final1-wkgbtr to <fs> it is not moving.

can we pass the currency feild to the feild symbols directly???????

Tags:
Former Member
Former Member replied

I can guess why it is not working, it is because of fieldcatalog. if you don't populate the fieldcatalog properly then you will get that problem.

I guess you are doing it manually. when you are populating manually you have to consider the following

*FIELDNAME NETPR *

CFIELDNAME WAERK

DATATYPE CURR

REF_TABLE VBAP

*DD_OUTLEN *

DECIMALS

then only you can assign the value properly.

just check this..

REPORT ztest_dynamic.

DATA: t_fcat TYPE lvc_t_fcat,
      itab   type ref to data,
      wa     type ref to data.
data: it_vbap type vbap_t,
      wa_vbap type vbap.

field-symbols: <final> type standard table,
               <fs_wa> type any,
               <fs> type any.

CALL FUNCTION 'LVC_FIELDCATALOG_MERGE'
 EXPORTING
   I_STRUCTURE_NAME             = 'VBAP'
  CHANGING
    ct_fieldcat                  = t_fcat
 EXCEPTIONS
   INCONSISTENT_INTERFACE       = 1
   PROGRAM_ERROR                = 2
          .
CALL METHOD cl_alv_table_create=>create_dynamic_table
EXPORTING
it_fieldcatalog = t_fcat
IMPORTING
ep_table = itab.

ASSIGN itab->* TO <final>.

create data wa like line of <final>.
assign wa->* to <fs_wa>.

select * from vbap
into table it_vbap
up to 2 rows.

loop at it_vbap into wa_vbap.

assign component 'NETPR' of structure <fs_wa> to <fs>.
if sy-subrc eq 0.
  <fs> = wa_vbap-netpr.
  write:/ <fs>.
endif.

endloop.

0 View this answer in context
Not what you were looking for? View more on this topic or Ask a question