2013 May 15 6:40 AM
Hi All,
I have a below requirment:
A workarea e_final has different fields populated such as MATNR/VKORG/VTWEG etc.
A Internal table is_dfies which holds the key fileds of any table.
Now I want to concatenate the the value from e_final for the fields in is_dfies in to a variable filed.
Could you please suggest how to achive this.
Regards,
Ravi Kasnale
Moderator message: Please do some research before posting
Message was edited by: Kesavadas Thekkillath
Hi All,
I have a below requirment:
A workarea e_final has different fields populated such as MATNR/VKORG/VTWEG etc.
A Internal table is_dfies which holds the key fileds of any table.
Now I want to concatenate the the value from e_final for the fields in is_dfies in to a variable filed.
Could you please suggest how to achive this.
Regards,
Ravi Kasnale
Moderator message: Please do some research before posting
Message was edited by: Kesavadas Thekkillath
2013 May 15 6:53 AM
Hi,
I think that is what you need:
FIELD-SYMBOLS : <value> type any.
loop at is_dfies
into ls_dfies.
ASSIGN COMPONENT ls_dfies-fieldname OF STRUCTURE e_final TO <value>.
IF sy-subrc EQ 0.
CONCATENATE lv_variable <value> INTO lv_variable.
CONDENSE lv_variable.
UNASSIGN <value>.
ENDIF.
endloop.
Regards
2013 May 15 6:57 AM
Jusr use an ASSIGN COMPONENT dfies-fieldname OF STRUCTURE e_final syntax, use the field name from dfies in a LOOP.
Regards,
RAymond
2013 May 15 7:18 AM
Hi Ravi,
From your requirement what I understood is, the output should be like <key_field_name> = <value_of_that_field>.
Here's the code for this:
FIELD_SYMBOL:
<fs_value> TYPE any.
LOOP AT is_dfies INTO wa_dfies.
ASSIGN COMPONENT wa_dfies OF STRUCTURE e_final TO <fs_value>.
IF sy-subrc = 0.
CONCATENATE is_dfies-fieldname '=' <fs_value> INTO lv_variable SEPEARTED BY space.
ENDIF.
ENDLOOP.
| User | Count |
|---|---|
| 3 | |
| 2 | |
| 2 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |