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 Structures and Internal Tables

Former Member
0 Likes
862

Hi All,

I am doing a report to create condition records based on the condition type and condition table. Assume the condition type as PR00 and it as condition table of 304,305,306.Each condition table as its own header and item fields.Based on the  condition table that the user specifies in the selection screen

the header and item structures of my report should change dynamically and these should be moved  to the dynamic internal table that contains both header and item fields.Can anyone give an idea how to achieve it. Thanks in advance.

Regards,

Chakradhar.

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
835

Hi All,

Thanks for your replies.

SPLIT i_string_line-input_str AT cl_abap_char_utilities=>horizontal_tab

INTO i_header_line-header
          i_header_line-vkorg
          i_header_line-vtweg                                                                              
          i_header_line-pltyp                                                                              
         i_header_line-waerk.    


In the above syntax based on the condition table I selected on selection screen my flat file is as below.


case 1: If condition table given is 304

H    SalesOrganization    DistributionChannel    Customer

I    Material    Releasestatus    Amount    Currency    ValidFrom    ValidTo


case 2: If condition table given is 305

H    SalesOrganization    DistributionChannel

I    Material    Releasestatus    Amount    Currency    ValidFrom    ValidTo


case 3: If condition table given is 306

H    SalesOrganization    DistributionChannel     PriceListType     DocumentCurrency

I    Material    Releasestatus    Amount    Currency    ValidFrom    ValidTo

                                                         

In the above code i_string_line-input_str contains the following heading of fields based on the condition table we select in selection screen.when I want to split them into respective fields

using INTO clause my structure should change dynamically.How can I achieve it and my entire program is in OOPS ALV.Thanks in Advance.


Regards,

Chakradhar.


 

4 REPLIES 4
Read only

Former Member
0 Likes
835

Hi Chakri,

Please make use of the concepts of field symbols for doing this.They can dynamically hold incoming values at runtime without any predefined types.

https://help.sap.com/saphelp_nw04/helpdata/en/fc/eb3860358411d1829f0000e829fbfe/content.htm

http://help.sap.com/abapdocu_70/en/ABAPFIELD-SYMBOLS.htm

Regards,

Kannan

Read only

thangam_perumal
Contributor
0 Likes
835

Hi Chakri,

             Please refer below link

http://scn.sap.com/docs/DOC-42525

Regards,

  Thanagm.P

Read only

rajkumarnarasimman
Active Contributor
0 Likes
835

Hi Chakri,

We can do the change in the structure using dynamic internal table concept. Please find the following link to create the dynamic internal Table.

Link:

Example:

Regards

Rajkumar Narasimman

Read only

Former Member
0 Likes
836

Hi All,

Thanks for your replies.

SPLIT i_string_line-input_str AT cl_abap_char_utilities=>horizontal_tab

INTO i_header_line-header
          i_header_line-vkorg
          i_header_line-vtweg                                                                              
          i_header_line-pltyp                                                                              
         i_header_line-waerk.    


In the above syntax based on the condition table I selected on selection screen my flat file is as below.


case 1: If condition table given is 304

H    SalesOrganization    DistributionChannel    Customer

I    Material    Releasestatus    Amount    Currency    ValidFrom    ValidTo


case 2: If condition table given is 305

H    SalesOrganization    DistributionChannel

I    Material    Releasestatus    Amount    Currency    ValidFrom    ValidTo


case 3: If condition table given is 306

H    SalesOrganization    DistributionChannel     PriceListType     DocumentCurrency

I    Material    Releasestatus    Amount    Currency    ValidFrom    ValidTo

                                                         

In the above code i_string_line-input_str contains the following heading of fields based on the condition table we select in selection screen.when I want to split them into respective fields

using INTO clause my structure should change dynamically.How can I achieve it and my entire program is in OOPS ALV.Thanks in Advance.


Regards,

Chakradhar.