cancel
Showing results for 
Search instead for 
Did you mean: 

scripts & smartforms

Former Member
0 Kudos

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

Accepted Solutions (0)

Answers (1)

Answers (1)

Former Member
0 Kudos

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

Former Member
0 Kudos

Thanks for ur valuable suggetion.

But how can i insert name of logo in initialization tab.

In script what u have sent is for changing program but i want with out changing the print program. please send me in detail.

Thanks & Regards.

Hari.

Former Member
0 Kudos

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.