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

creating abap program to develop and activate a global table type and global structure.

sanjeev_mishra_15aug
Active Participant
0 Likes
2,838

Hi friends,

I want to create and activate a global structure and global table type by coding in ABAP editor only. so can I do that anyhow.

Please help me.

Thanks in advance.

1 ACCEPTED SOLUTION
Read only

sanjeev_mishra_15aug
Active Participant
0 Likes
2,151

Thanks guys for your fruitful replies, as most of you asked the main purpose of my question, the answer is as follows:

in fact my purpose to do so is to create a function module that can fetch data dynamically from different database tables based on the codings in different abap program.

for example: in one abap program i am coding as follows:

tables: kna1.

types: begin of itab,

          kunnr type kna1-kunnr,

          name1 type kna1-name1,

          end of itab.

data: it_tab type standard table of itab,

         wa_tab type itab.

similarly in other program i am coding as follows:

tables: vbrp.

types: begin of itab,

          posnr type vbrp-posnr,

          matnr type vbrp-matnr,

          arktx type vbrp-arktx,

          end of itab.

data: it_tab type standard table of itab,

         wa_tab type itab.

so now for both programs i want to call the same function module and fetch data as required in relative programs as mentioned above. in that case how to create that function module?

12 REPLIES 12
Read only

philipdavy
Contributor
0 Likes
2,151
  • You can create a structure and table type in se11 which will serve as global structure and global table type.
  • Otherwise create a global class in SE24 and declare the structure type and table type there and try to access this class from your calling program.

Regards,

Philip.

Read only

matt
Active Contributor
0 Likes
2,151

Why? If you explain the reasons why you think you need this, we might be able to better suggest answers.

Read only

0 Likes
2,151

HI,

   i think it's not possible if it is possible then there is no meaning to use DDIC

Read only

0 Likes
2,151

Of course it is possible - how else does SAPLInk work? The question is why does the OP want to do this?

Read only

0 Likes
2,151

A wild guess. REUSE*ALV* FM field catalog does not work well for local structures. So OP wants to dynamically create a DDIC structure and then use REUSE* FM with satisfactory results.

Read only

0 Likes
2,151

This message was moderated.

Read only

0 Likes
2,151

The solution in that case is to use CL_SALV_TABLE

Read only

sanjeev_mishra_15aug
Active Participant
0 Likes
2,152

Thanks guys for your fruitful replies, as most of you asked the main purpose of my question, the answer is as follows:

in fact my purpose to do so is to create a function module that can fetch data dynamically from different database tables based on the codings in different abap program.

for example: in one abap program i am coding as follows:

tables: kna1.

types: begin of itab,

          kunnr type kna1-kunnr,

          name1 type kna1-name1,

          end of itab.

data: it_tab type standard table of itab,

         wa_tab type itab.

similarly in other program i am coding as follows:

tables: vbrp.

types: begin of itab,

          posnr type vbrp-posnr,

          matnr type vbrp-matnr,

          arktx type vbrp-arktx,

          end of itab.

data: it_tab type standard table of itab,

         wa_tab type itab.

so now for both programs i want to call the same function module and fetch data as required in relative programs as mentioned above. in that case how to create that function module?

Read only

0 Likes
2,151
  • Then you should have re framed your question as how to build dynamic structure and dynamic internal table. The concepts like RTTC and RTTS exists for that. RTTC_Run Time Type Services

Regards,

Philip.

Read only

sanjeev_mishra_15aug
Active Participant
0 Likes
2,151

Thanks friends,

Can I have a detailed information regarding RTTC, RTTS AND CL_SALV_TABLE, please.

I couldn't understand how to use these concept while creating a function module?

Read only

0 Likes
2,151

Yes you can. Sufficient information can be found by searching.

Read only

0 Likes
2,151

Dynamic Internal table - ABAP Development - SCN Wiki

Hi Sanjeev

Please Check this link if you are not satisfied i will create a demo program using dynamic structures in function modules