Application Development and Automation 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: 
Read only

dynamic structure field change

Former Member
0 Likes
525

hi,

i am having one structure. structure having 20 columns. Each columns have 30 entries.. now i want to fill the first column of 30 entries.. after filled the first column dynamilly goes to second column.. column names like col1 col2 col3 like this ..

now my coding like this

do l_days times.

PJCPDETAILS-col11 = L_BOUTIQUES.

append pjcpdetails.

enddo.

once the loop will complete 30 times after that PJCPDETAILS-col11 should be PJCPDETAILS-col12 .. how to do this ?

Regards,

kumar

hi,

i am having one structure. structure having 20 columns. Each columns have 30 entries.. now i want to fill the first column of 30 entries.. after filled the first column dynamilly goes to second column.. column names like col1 col2 col3 like this ..

now my coding like this

do l_days times.

PJCPDETAILS-col11 = L_BOUTIQUES.

append pjcpdetails.

enddo.

once the loop will complete 30 times after that PJCPDETAILS-col11 should be PJCPDETAILS-col12 .. how to do this ?

Regards,

kumar

2 REPLIES 2
Read only

Former Member
0 Likes
484

hi,

try like this

do l_days times.

if sy-index le 30.

PJCPDETAILS-col11 = L_BOUTIQUES.

append pjcpdetails.

endif.

if sy-index le 60.

w_index = sy-index - 30.

PJCPDETAILS-col12 = L_BOUTIQUES.

modify table itab index w_index traspoting col12.

endif

enddo.

regards,

ananth

Read only

LeonardoAraujo
SAP Mentor
SAP Mentor
0 Likes
484

Get the definition of the fields you have in the structure using class CL_ABAP_STRUCTDESCR.

Once you have a internal table with all the field names in it, use the following syntax:


Loop at IT_FIELDS into wa_FIELDS.
Assign component wa_fields-fieldname of PJCPDETAILS to XXXXX
endloop.

Leonardo De Araujo