on 12-08-2006 3:24 PM
Hi all.
please can anyone give me a CODE for script and a smartform In which Logoes are dynamically inserted based on company code done by u?
If company code is not there on what basis we will insert logoes dynamically compare to company code.
WITH OUT CHANGING A PRINT PROGRAM.
please help me.
Thanks & Regards.
Hari.
my mail id is : haric@hcl.in
Hi
Just as I said in your you have to use a variable to store the name of the logo in according to campany code.
- SMARTFORM you can insert the name of the logo in the INIZIALIZATION tab of GLOBAL DEFINATION section:
In GLOBAL DATA you define the variable V_LOGO and in INITIALIZATION you fill it or you can create an ABAP node, before calling the GRAPHIC node, where you fill the variable V_LOGO
- SAPSCRIPT you have to define you variable in the sapscript and then create a routine to fill it:
/: DEFINE &V_LGO& = ' '
/: PERFORM GET_LOGO IN PROGRAM <ZPROGRAM>
USING &COMAPANY_CODE&
CHANGING &V_LOG&
/: ENDPERFORM
/: BITMAP &V_LOGO& OBJECT GRAPHICS ID BMAP TYPE BCOL
In ZPROGRAM you have to define the routine GET_LOGO:
REPORT ZPROGRAM.
FORM GET_LOG0 TABLES IN_TAB STRUCTURE ITCSY
OUT_TAB STRUCTURE ITCSY.
DATA: BUKRS TYPE BUKRS.
* Get company code:
READ TABLE IN_TAB WITH KEY NAME = 'COMPANY_CODE'
IF SY-SUBRC = 0.
BUKRS = IN_TAB-VALUE.
* Set logo name
READ TABLE OUT_TAB WITH KEY NAME = 'V_LOGO'
IF SY-SUBRC = 0.
* Here insert the code you need to get the name
CONCATENATE 'ZLOGO_' BUKRS INTO OUT_TAB-VALUE.
MODIFY OUT_TAB INDEX SY-TABIX.
ENDIF.
ENDIF.
ENDFORM.
Or you can use a IF statament
/: IF &COMAPANY_CODE& = '0001'
/: BITMAP ZLOGO_0001 OBJECT GRAPHICS ID BMAP TYPE BCOL
/: ELSEIF &COMAPANY_CODE& = '0002'
/. BITMAP ZLOGO_0002 OBJECT GRAPHICS ID BMAP TYPE BCOL
/: ENDIF.
Max
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
max bianchi showed you both ways. If you reference his <u><b>OR</b></u> above you will see the way in which you can get the SO10 object or SE78 BMP. This process is quite simple (relatively speaking). Remember the SO10 uses the INCLUDE to retrieve a text based image and SE78 pictures use the BITMAP to retrieve an actual picture stored in SAP.
Evaluate the company code you have and then based on what you want to do with each one you code your logic.
User | Count |
---|---|
89 | |
10 | |
9 | |
9 | |
9 | |
6 | |
6 | |
5 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.