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

SET TITLE BAR

Former Member
0 Likes
12,007

Hello Experts.

i m facing probel in simple report to set a title bar

i have 2 t-codes for a report(<b>zinv01</b> and <b>zinv02</b>)

if user go by zinv01

report title should be <b>'abc ltd'</b>

and if user go by zinv02

report title should be <b>'xyz ltd'</b>

pls help me on this

i hv tried in initialization ,at selection screen putput, start-of-selection.

thanks in advance ...

points will be rewarded..

Regards

Rajan Mehta

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
6,756

HI,

create a title with TIT1 as the name and text as 'abc company' and create a title with TIT2 as the name and text as 'xyz company'

case sy-tcode.

when 'ZINV01'.

set titlebar 'TIT1'.

when 'ZINV02'.

set titlebar 'TIT2'.

endcase.

(or)

create a title with TIT1 as the name and text as '&1 company'

case sy-tcode.

when 'ZINV01'.

set titlebar 'TIT1' with 'abc'."abc will be moved to &1

when 'ZINV02'.

set titlebar 'TIT1' with 'xyz'."xyz will be moved to &1

endcase.

rgds,

bharat.

HI,

create a title with TIT1 as the name and text as 'abc company' and create a title with TIT2 as the name and text as 'xyz company'

case sy-tcode.

when 'ZINV01'.

set titlebar 'TIT1'.

when 'ZINV02'.

set titlebar 'TIT2'.

endcase.

(or)

create a title with TIT1 as the name and text as '&1 company'

case sy-tcode.

when 'ZINV01'.

set titlebar 'TIT1' with 'abc'."abc will be moved to &1

when 'ZINV02'.

set titlebar 'TIT1' with 'xyz'."xyz will be moved to &1

endcase.

rgds,

bharat.

23 REPLIES 23
Read only

former_member386202
Active Contributor
0 Likes
6,756

Hi,

Us esystem field sy-tcode to check the current tcode.

Regards,

Prashant

Read only

0 Likes
6,756

if syst-tcode = 'ZINV01'.

<b> set TITLEBAR 'TITLE' .</b>"OF PROGRAM 'Z_TEST'.

ELSEIF syst-tcode = 'ZINV02'.

<b>set TITLEBAR 'TITLE1' .</b>"OF PROGRAM 'Z_TEST'.

ENDIF.

BUT IT GOES INTO IF CONDITION BUT SY-SUBRC BECOMES 4.

AND I M NOT GETTING THE RESULT...

Read only

Former Member
0 Likes
6,757

HI,

create a title with TIT1 as the name and text as 'abc company' and create a title with TIT2 as the name and text as 'xyz company'

case sy-tcode.

when 'ZINV01'.

set titlebar 'TIT1'.

when 'ZINV02'.

set titlebar 'TIT2'.

endcase.

(or)

create a title with TIT1 as the name and text as '&1 company'

case sy-tcode.

when 'ZINV01'.

set titlebar 'TIT1' with 'abc'."abc will be moved to &1

when 'ZINV02'.

set titlebar 'TIT1' with 'xyz'."xyz will be moved to &1

endcase.

rgds,

bharat.

Read only

0 Likes
6,756

I HV USED SY-TCODE BUT IT IS NOT WORKING

WHERE I HV TO MENTION IT..

IN <b>INITIALIZATION</b> OR IN <b>START-OF-SELECTION</b> OR

<b> AT SELECTION SCREEN</b>

I HV TRIED IN EVERY PLACE BUT

IM NOT GETTING THE RESULT

Read only

0 Likes
6,756

HI,

if the title is for screen means mention it in at selection-screen.

if the title is for report means mention it in start-of-selection.

rgds,

bharat.

Read only

0 Likes
6,756

Try using SY-CPROG

Read only

0 Likes
6,756

THNKS MAN

but still i m not getting the title

following is the test prog i hv created....

pls see to it .

report ZVBN1_BDC.

INITIALIZATION.

*TXT_001 =

*set TITLEBAR 'TITLE1' OF PROGRAM SY-REPID WITH 'TEST TITLEBAR'.

TABLES : mara.

SELECT-OPTIONS: s_mtart for mara-mtart.

*IF s_mtart IS NOT INITIAL.

*SET PF-STATUS 'STATUS'.

AT SELECTION-SCREEN .

*set TITLEBAR 'TITLE1' OF PROGRAM SY-REPID WITH 'TEST TITLEBAR'.

SET TITLEBAR 'TIT1' OF PROGRAM SY-CPROG.

  • ENDIF.

*if syst-tcode = 'ZTST'.

  • set TITLEBAR 'TITLE' ."OF PROGRAM 'Z_TEST'.

    • CALL TRANSACTION 'ZTST'.

    • ELSEIF syst-tcode = 'ZTST19'.

**set TITLEBAR 'AAAAAAAAAAAAAA' ."OF PROGRAM 'Z_TEST'.

    • SET TITLEBAR 'TITLE'.

*

*ENDIF.

START-OF-SELECTION.

WRITE / 'rajan'.

Read only

0 Likes
6,756

THNKS sir

but still i m not getting the title

following is the test prog i hv created....

pls see to it .

report ZVBN1_BDC.

INITIALIZATION.

*TXT_001 =

*set TITLEBAR 'TITLE1' OF PROGRAM SY-REPID WITH 'TEST TITLEBAR'.

TABLES : mara.

SELECT-OPTIONS: s_mtart for mara-mtart.

*IF s_mtart IS NOT INITIAL.

*SET PF-STATUS 'STATUS'.

AT SELECTION-SCREEN .

*set TITLEBAR 'TITLE1' OF PROGRAM SY-REPID WITH 'TEST TITLEBAR'.

SET TITLEBAR 'TIT1' OF PROGRAM SY-CPROG.

  • ENDIF.

*if syst-tcode = 'ZTST'.

  • set TITLEBAR 'TITLE' ."OF PROGRAM 'Z_TEST'.

    • CALL TRANSACTION 'ZTST'.

    • ELSEIF syst-tcode = 'ZTST19'.

**set TITLEBAR 'AAAAAAAAAAAAAA' ."OF PROGRAM 'Z_TEST'.

    • SET TITLEBAR 'TITLE'.

*

*ENDIF.

START-OF-SELECTION.

WRITE / 'rajan'.

Read only

0 Likes
6,756

HI,

TABLES : mara.

SELECT-OPTIONS: s_mtart for mara-mtart.

<b>AT SELECTION-SCREEN OUTPUT."this is for selection screen.</b>

if sy-tcode = 'ZTST'.

set TITLEBAR 'TIT' ."OF PROGRAM 'Z_TEST'.

ELSEIF sy-tcode = 'ZTST19'.

SET TITLEBAR 'TIT1'.

ENDIF.

<b>START-OF-SELECTION.</b>

if sy-tcode = 'ZTST'.<b>"this is for list</b>

set TITLEBAR 'TIT' ."OF PROGRAM 'Z_TEST'.

ELSEIF sy-tcode = 'ZTST19'.

SET TITLEBAR 'TIT1'.

ENDIF.

WRITE / 'rajan'.

rgds,

bharat.

Read only

0 Likes
6,756

Hi Rajan

As per SAP Help:

Addition 1

... OF PROGRAM prog

Effect

The system does not search in the GUI of the main program of the current program group for f, but in the program specified in the field prog.

Hence <b>please check if you have created title TIT1 in your original/calling program</b>

Reg,

Arun

Read only

0 Likes
6,756

THANK U VERY MUCH SIR

BUT STILL WHEN IT GOES INTO IF CONDITION AFTER FULLFILLING THE CONDITION..

EXP.

<b>if sy-tcode = 'ZRJ'.

set TITLEBAR 'TIT' ."OF PROGRAM 'Z_TEST'.

ELSEIF sy-tcode = 'ZTST19'.

SET TITLEBAR 'TIT1'.

ENDIF.</b>

<b>SY-SUBRC</b> BECOMES <b>4</b>.

SO I M NOT GETTING THE TITLE.

PLS HELP ME ON THIS.

RGDS,

rajan mehta

Read only

0 Likes
6,756

ya when i m double clicking the title that i hv created

it was showing me the program name

that is the same for which i m creating the title..

Read only

0 Likes
6,756

Check if your titlebar is active...

Read only

0 Likes
6,756

HI,

send me ur code after modification.

u r keeping it in at selection-screen.,

but u have to keep it in at selection-screen output in order to fix the title to the screen.

rgds,

bharat.

Read only

0 Likes
6,756

HI,

send me ur code after modification.

u r keeping it in at selection-screen.,

but u have to keep it in at selection-screen output in order to fix the title to the screen.

rgds,

bharat.

Read only

0 Likes
6,756

in your start of selection.

if sy-tcode = 'ZRJ'.

SY-TITLE = 'TIT' ."OF PROGRAM 'Z_TEST'.

ELSEIF sy-tcode = 'ZTST19'.

SY-TITLE = 'TIT1'.

ENDIF.

this should wrk hopefully..

Read only

0 Likes
6,756

REPORT Z_TEST11 NO STANDARD PAGE HEADING.

TABLES : mara.

SELECT-OPTIONS: s_mtart for mara-mtart.

AT SELECTION-SCREEN OUTPUT."this is for selection screen.

if sy-tcode = 'ZRJ'.

set TITLEBAR 'TIT' ."OF PROGRAM 'Z_TEST'.

ELSEIF sy-tcode = 'ZTST19'.

SET TITLEBAR 'TIT1'.

ENDIF.

START-OF-SELECTION.

if sy-tcode = 'ZRJ'."this is for list

set TITLEBAR 'TIT' ."OF PROGRAM 'Z_TEST'.

ELSEIF sy-tcode = 'ZTST19'.

SET TITLEBAR 'TIT1'.

ENDIF.

WRITE / 'rajan'.

Read only

0 Likes
6,756

HI,

i have tested it on my system.it will work fine.

are u testing it through the tcodes (ZRJ and ZTST19) or from se 38.

rgds,

bharat.

Read only

0 Likes
6,756

no i m checking from <b>zrj</b> tcode.

not from se38.

Read only

0 Likes
6,756

IT IS WORKING NOW

SO FOOLISH I M

I WAS NOT ACTIVATING THE TITLE SO SY-SUBRC BECOMES 4.

THXS FOR YOUR KIND HELP

10 TO U AIR

Read only

0 Likes
6,756

Use sy-title directly to overwrite whatever the dynamic texts that you required for the program.

Hope this solves your problem. Reward points if solved.

Thanks,

Buvana.

Read only

Former Member
0 Likes
6,756

Hello Rajan

For solving this problem create your titlebar with '&'

Example create YTEST with title '&'

if tcode = zinv01

SET TITLEBAR 'YTEST' WITH TEXT-001. " Text-001 = abc ltd

else.

SET TITLEBAR 'YTEST' WITH TEXT-002. " TExt-002 = xyz ltd

endif.

Read only

Former Member
0 Likes
6,756

when 'ZINV01'.

SY-TITLE = 'TIT1'.

when 'ZINV02'.

SY-TITLE = 'TIT2