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

Explain: Why we need Tcode for ALV report?

Former Member
0 Likes
1,379

Hi,

I copied one of my ALV report to a local program to add one more column into ALV display.

+ When I tested my local program I used F8 to run directly my report - I CAN NOT see my added column.

+ If I created a Tcode for my local program and ran it from Tcode - The added column is displayed.

Please explain for me the reason why.

Thanks,

Khanh

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
1,297

Hi all,

I tested carefully and found that my new column is only displayed in the local program if:

+ I create a TCode for my local program

+ I have to run this report using this Tcode at least one time (after that my new column will always be displayed)

Thanks,

Khanh

12 REPLIES 12
Read only

Former Member
0 Likes
1,298

Hi all,

I tested carefully and found that my new column is only displayed in the local program if:

+ I create a TCode for my local program

+ I have to run this report using this Tcode at least one time (after that my new column will always be displayed)

Thanks,

Khanh

Read only

0 Likes
1,297

There is no difference between calling a report by SE38 or by a transaction code that calls the same report.

The transaction code is like a short cut for that report.

Maybe the problem has to do with activating/generating the code ?

regards,

Hans

Read only

0 Likes
1,297

Hi Senden,

I agree with you that TCode is just the shortcut for the program but my case is a bit different:

I debugged and found that my report used FM REUSE_ALV_FIELDCATALOG_MERGE to build field cat.

If no Tcode is created and run for this report at least one time this FM can not generate the new column in output.

I still don't know the reason why.

Thanks,

Khanh

Read only

0 Likes
1,297

Hi,

there is no difference using SE38 or by Tcode.... We create transaction codes inorder to go directly to the selection screen, instead of typing the program name and executing it which is not needed for endusers....also tcode gives easy navigation.

Regards,

Nagarak

Read only

0 Likes
1,297

can you please show how you are calling the FM fieldcat merge?

Read only

0 Likes
1,297

Hi,

Have u passed the program name correctly...when u copy a program , please see the REPORT program name is ur copied one.

use SY-CPROG.

Regards,

Nagaraj

Read only

0 Likes
1,297

Hi Mishra,

Here is my code to call the FM

CALL FUNCTION 'REUSE_ALV_FIELDCATALOG_MERGE'
       EXPORTING
            i_program_name         = v_repid
            i_internal_tabname     = v_tab
            i_inclname             = v_incl
       CHANGING
            ct_fieldcat            = i_field[]
       EXCEPTIONS
            inconsistent_interface = 0
            program_error          = 0
            OTHERS                 = 0.

Where: v_tab stores the name of output internal table

v_repid stores the name of my report

v_incl stores the name of the include (here the include name and program name are the same)

Thanks,

Khanh

Read only

0 Likes
1,297

you have to pass sy-repid in include name and program of that FM

Read only

0 Likes
1,297

hi Khanh,

see the values for v_repid and v_incl, i guess here you are passing the wrong names. you can directly pass sy-repid.

Read only

0 Likes
1,297

Hello,

Before calling the FM I also add the new column in I_FINAL definition.

v_tab = 'I_FINAL'.

*

MOVE sy-repid TO : v_repid,
                     v_incl.

The problem is not at passing parameters. All are correct.

Thanks,

Khanh

Read only

0 Likes
1,297

and the v_tab has the new table columns?

Read only

Former Member
0 Likes
1,297

Closed.

Not answered.