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 program Title

Former Member
0 Likes
4,893

Hi all,

i am have to make a dynamic attribute for a report, can anyone please help me? actually i made 6 pushbutton on selection screen and after click of every pushbutton i want to call same Z program with different program title.

can anyone please help me?

regards

7 REPLIES 7
Read only

Former Member
0 Likes
2,283

Hello,

I guess program attribute title will remain same however to set the list title create 6 different PF-status. And set those PF-status as per your requirement( the button).

Regards,

Amarjit

Read only

vinod_vemuru2
Active Contributor
0 Likes
2,283

Hi,

You can populate the variable SY-TITLE for this.

Check below sample code where i am changing the title based on selection screen input.


PARAMETERS: po_1 TYPE c.

END-OF-SELECTION.
CASE po_1.
WHEN 1.
sy-title = 'Title1'.
WHEN 2.
sy-title = 'Title2'.
WHEN OTHERS.
sy-title = 'Other title'.
ENDCASE.

WRITE: 'Test'.

Thanks,

Vinod.

Read only

Former Member
0 Likes
2,283

Hi Saurabh,

I think you can achieve this using your own PF-STATUs for each of the six scenarious and change them in

even AT SELECTION-SCREEN.

In order to copy standard PF-STATUS do it fom (Standard prog. to copy GUI status - SAPLKKBL) and use transaction 'SE41'.

Regards,

Salil Sonam.

Read only

0 Likes
2,283

hello all,

thanx for reply...actually i made Text element for all the title and now on user selection i m transferring it in SY-TITLE under event AT SELECTION-SCREEN OUTPUT, but still it is not changing. i putted the program title &1&2 while creating program but now it is not overwriting.

can anyone plz help me?

code:

AT SELECTION-SCREEN OUTPUT.

IMPORT GC_FLG1 FROM MEMORY ID 'GV_FLG'.

if GC_FLG1 ne lc_blk.

lv_flg = GC_FLG1.

sy-title = text-008.

endif.

IMPORT GC_FLG2 FROM MEMORY ID 'GV_FLG'.

if GC_FLG2 ne lc_blk.

lv_flg = GC_FLG2.

sy-title = text-009.

endif.

IMPORT GC_FLG3 FROM MEMORY ID 'GV_FLG'.

if GC_FLG3 ne lc_blk.

lv_flg = GC_FLG3.

sy-title = text-010.

endif.

IMPORT GC_FLG4 FROM MEMORY ID 'GV_FLG'.

if GC_FLG4 ne lc_blk.

lv_flg = GC_FLG4.

sy-title = text-011.

endif.

IMPORT GC_FLG5 FROM MEMORY ID 'GV_FLG'.

if GC_FLG5 ne lc_blk.

lv_flg = GC_FLG5.

sy-title = text-012.

endif.

IMPORT GC_FLG6 FROM MEMORY ID 'GV_FLG'.

if GC_FLG6 ne lc_blk.

lv_flg = GC_FLG6.

sy-title = text-013.

endif.

IMPORT GC_FLG7 FROM MEMORY ID 'GV_FLG'.

if GC_FLG7 ne lc_blk.

lv_flg = GC_FLG7.

sy-title = text-014.

endif.

regards.

Read only

Former Member
0 Likes
2,283

Hi,

After creating the text elements for each of the program,

then you can assign that text elements to the titles on the

AT Selection-Screen event.

Hope it helps

Regards

Mansi

Read only

Former Member
0 Likes
2,283

Hi Saurabh,

If you want to display the title after you press push button on the selection screen, then at event START-OF-SELECTION you can write the logic same logic as you tried in AT-SELECTION-SCREEN OUTPUT.

I think this will solve your problem.

Read only

Former Member
0 Likes
2,283

Hi,

You can modify your program name dynamically in the Initialization of your program Z.

For example :

Initialization.

If sy-tcode = 'ZTCODE1'.

sy-tittle = 'Program name 1'.

endif.

Regards,

Younes