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

Graphic Window in SAPScript

Former Member
0 Likes
1,969

Hello all,

I want to print a graphic element, included in a graphic window, conditionally.

Is there a way to print this window only when certain conditions are fulfilled (this will be checked in the print program)

or

the window will always print, regardless the conditions?

If case 2 it true, then is there another way to achieve my client's desire?

Best regards,

Bogdan

1 ACCEPTED SOLUTION
Read only

RichHeilman
Developer Advocate
Developer Advocate
0 Likes
1,563

Not sure that you can do this in the print program. I have done this in the past by putting an IF statement around the BITMAP statement in the SAPscript itself. Worked pretty good. I did have to define a field in the print program which when I wanted to print the image, I set it to "X", and space when not. Then in the sapscript.

IF &FLAG& = 'X'
BITMAP .....

ENDIF

REgards,

Rich HEilman

11 REPLIES 11
Read only

RichHeilman
Developer Advocate
Developer Advocate
0 Likes
1,564

Not sure that you can do this in the print program. I have done this in the past by putting an IF statement around the BITMAP statement in the SAPscript itself. Worked pretty good. I did have to define a field in the print program which when I wanted to print the image, I set it to "X", and space when not. Then in the sapscript.

IF &FLAG& = 'X'
BITMAP .....

ENDIF

REgards,

Rich HEilman

Read only

0 Likes
1,563

Yes, sure you're right.

Thanks,

Bogdan

Read only

Former Member
0 Likes
1,563

HI,

You can always use condition in the script directly.

For example.

/: IF &EKPO-WERKS& EQ '0011'.

/: INCLUDE ZHEX-MACRO-NEW OBJECT TEXT ID ST LANGUAGE EN PARAGRAPH Z4

/: ELSE

/: INCLUDE ZHEX-MACRO-MINEPRO OBJECT TEXT ID ST LANGUAGE EN

/: ENDIF

Read only

Former Member
0 Likes
1,563

Hi,

Create a graphic window(Ex,Graph).Define a text element as Test (Ex. /E Test).

In your driver program :

Use following function and call this function based on your conditions.

CALL FUNCTION 'WRITE_FORM'

EXPORTING

ELEMENT = TEST

WINDOW = 'GRAPH'.

Lanka

Read only

0 Likes
1,563

How do I do that, Lanka?

As hard as I try, I cannot edit the content (SAPScript text) of a graphic window.

Maybe I'm missing something?

Bogdan

Read only

0 Likes
1,563

Hi,

You will be able to go into the change mode & go to elements & change.

Read only

0 Likes
1,563

It seems I'm NOT able to do that, with a graphic window.

I repeat, am I missing something?

BR,

Bogdan

Read only

0 Likes
1,563

Hi Bogdan,

Can you please send me your code to murthy.narayana@intelligroup.com

I will check and let you know.

Lanka

Read only

0 Likes
1,563

Lanka, thank you, I solved the problem,

BUT you raised another interesting issue here: the possibility to edit manually the SAPScript of a Graphic window.

My question was: Is that possible? And if it is, how to do it? I tried in several diferent ways, without success.

Can you help?

Thanks,

Bogdan

Read only

0 Likes
1,563

Hi Bogdan,

Instead of creating a Graph window.Create a variable window & write the include to get the graph.Before that upload the graph into sap using program RSTXSCRP.

before uploading change the BMP file to .tiff file.

In the variable window you can write conditionally to get the graph.

Read only

0 Likes
1,563

Hi Bogdan,

What do you mean by manually edit Graph window? You can edit the window by setting a debugger by using T/code SE71.

How you solved your issue coding in driver program or in layout set?

Lanka