cancel
Showing results for 
Search instead for 
Did you mean: 

Smart Forms&scripts

Former Member
0 Kudos

Hi,

How to insert logos dynamically in smart forms and sap scripts based on company codes.

Actually my client has 3 different comapany codes for that I have to insert 3 different logos in smart forms as well as sap scripts.In smart forms we have to retrieve the company code based on the address number,without changing the print program.

Please help me.

Thanks

hari.

Accepted Solutions (0)

Answers (4)

Answers (4)

Former Member
0 Kudos

in smart forms use the program lines to select company code and take 3 logos in condition editor use that company code to print that logo or not.

like if company code = 1000 print logo1

company code = 1001 print logo2...

in scripts use the perform to select the Company code...

ex: PERFORM GET_COMP_CODE IN PROGRAM REPT USING &ADRC-ADRNR& CHANGING &COMP_CODE&

ENDPERFORM.

AND IN FORM DO LIKE THIS::

FORM GET_CANCEL_MARK TABLES IN_TAB STRUCTURE ITCSY

OUT_TAB STRUCTURE ITCSY.

TABLES: VBRK.

DATA: V_VBELN LIKE VBRP-VBELN,

ZINVCAN LIKE VBRK-FKSTO.

*---Read IN_TAB value, then move to local variables

READ TABLE IN_TAB WITH KEY 'VBDKR-VBELN'.

IF SY-SUBRC = 0.

*---Get Vbeln

V_VBELN = IN_TAB-VALUE+0(10).

PERFORM PAD_LEADING_ZEROS USING V_VBELN.

ENDIF.

*---

CLEAR VBRK.

SELECT SINGLE FKSTO INTO VBRK-FKSTO

FROM VBRK

WHERE VBELN = V_VBELN.

*---

IF SY-SUBRC = 0.

ZINVCAN = VBRK-FKSTO.

ENDIF.

*

READ TABLE OUT_TAB WITH KEY 'ZINVCAN'.

IF SY-SUBRC = 0.

MOVE ZINVCAN TO OUT_TAB-VALUE.

MODIFY OUT_TAB INDEX SY-TABIX.

ENDIF.

ENDFORM.

Former Member
0 Kudos

Hi Challa,

As stated by Vinay, you can use Case Endcase statement in SAP Script for dynamic printing of logos.

In case of smartforms,

You can use the condition tab in graphic node for selective display.

For Example:

If you want to display a logo in header window, Create 3(for 3 company codes) graphic nodes under it. and in each node's conkdition tab specify the condition.

<b>For first Graphic Node:</b>

Field Name - ITAB-BUKRS

Comparison Value - '001'.

<b>For second Graphic Node:</b>

Field Name - ITAB-BUKRS

Comparison Value - '002'.

<b>For third Graphic Node:</b>

Field Name - ITAB-BUKRS

Comparison Value - '003'.

Regards,

Vinod.

Former Member
0 Kudos

In the smart forms, you create a GRAPHIC node and you will be able to see the fields where you will have give the Graphic name etc etc.

Right next to the field for graphic name, there will be a button. When you click on that button and then a field will appear where you can specify the name of the variable which will hold the name of the graphic.

Create a Program lines node, before the graphic and write code to get the graphic name in the variable used according to your logic.

Regards,

Ravi

Note - Please mark all the helpful answers

Former Member
0 Kudos

Hi Hari,

Use <b>CASE..ENDCASE</b> control command in your script.

/:CASE &ITAB-BUKRS&

/: WHEN '0001'

/: BITMAP 'Z01' OBJECT GRAPHICS ID BMAP TYPE BMON DPI 150

/: WHEN '0002'

/: BITMAP 'Z02' OBJECT GRAPHICS ID BMAP TYPE BMON DPI 150

/: WHEN '0003'

/: BITMAP 'Z03' OBJECT GRAPHICS ID BMAP TYPE BMON DPI 150

/: ENDCASE

Thanks,

Vinay