2007 Nov 13 6:39 AM
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
2007 Nov 13 6:48 AM
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.
2007 Nov 13 6:44 AM
Hi,
Us esystem field sy-tcode to check the current tcode.
Regards,
Prashant
2007 Nov 13 6:51 AM
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...
2007 Nov 13 6:48 AM
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.
2007 Nov 13 6:53 AM
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
2007 Nov 13 6:56 AM
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.
2007 Nov 13 7:01 AM
2007 Nov 13 7:06 AM
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'.
2007 Nov 13 7:12 AM
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'.
2007 Nov 13 7:12 AM
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.
2007 Nov 13 7:19 AM
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
2007 Nov 13 7:23 AM
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
2007 Nov 13 7:26 AM
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..
2007 Nov 13 7:26 AM
2007 Nov 13 7:27 AM
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.
2007 Nov 13 7:27 AM
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.
2007 Nov 13 7:27 AM
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..
2007 Nov 13 7:29 AM
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'.
2007 Nov 13 7:40 AM
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.
2007 Nov 13 8:29 AM
2007 Nov 13 9:09 AM
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
2008 Feb 06 1:06 PM
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.
2007 Nov 13 6:51 AM
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.
2007 Nov 13 7:21 AM
when 'ZINV01'.
SY-TITLE = 'TIT1'.
when 'ZINV02'.
SY-TITLE = 'TIT2
| User | Count |
|---|---|
| 3 | |
| 2 | |
| 2 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |