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

Smartforms - Print different windows

Former Member
0 Likes
1,002

Hello,

I got a smartforms certificate with 3 different footer „types“ and my program. In the footer there is just some text included.

In my program, when I  click the the radio button ‚a‘ it should print the ‚a‘ footer from the smartforms.

When I click ‚b‘ in my transaction, it should print ‚b‘ and so on.

So my question is, how can I implement the check in my program/transaction or how can i get my program to print the various footer's?

Hopefully you can help me!

regards,

Simon

1 ACCEPTED SOLUTION
Read only

former_member821147
Participant
0 Likes
966

Hi,

First you declare variables in smaforms in global delcarion part and pass your input(radio button inputs) to that smartforms and then you can create window for footer and put condition in window based on above inputs got from program.

create different text for different footer texts then put condition based on inputs.

6 REPLIES 6
Read only

Former Member
0 Likes
966

Hi ,

You may have to pass a variable to the Smartforms from the print program , say x.

and populate it by a,b, c respectively when you click on the radio buttons a, b,c.

create a window in the footer  and create 3 texts to display the text lines for a  b  and c ..and in the condition tab check for X = a or b or c and print accordingly.

If they are not just texts ...you can create 3 windows also with same co ordinates and properties.

thnaks,


Read only

Former Member
0 Likes
966

Hi Gluck,

            

In you program Create a variable (flag) and pass it values when radio button is clicked, like

RADa - Radio button A

RADb - Radio button B

RADc - Radio button C

CASE sy-ucomm.

    

     when RADa = X.      "when radiobutton A is clicked

          flag = A.

     when RADB = X.      "when radiobutton B is clicked

          flag = B.

     when RADC = X.      "when radiobutton C is clicked

          flag = C.

ENDCASE.

Then pass the flag variable in form interface to the form in one of the exporting parameters,

In form INITIALIZATION put a simple IF statement,

IF flag = A.

     footer_text = "text1".

    

     ELSEIF flag = B.

     footer_text = "text2".

    

          ELSEIF flag = C.

              footer_text = "text3".

ENDIF.

Hope this helps!

Happy Coding,

Santhosh Yadav


Read only

VijayaKrishnaG
Active Contributor
0 Likes
966

Hi,

You create a Footer window and three different templates for three different footers in it. Now pass the Radio button value from program to smartform through Form Interface and place condition on the three different templates in CONDITIONS tab of template in Footer window. Like

IF VAR = 'A' for TEMPLATE A.

IF VAR = 'B' for TEMPLATE B

IF VAR = 'C' for TEMPLATE C

This will workout.

Regards,

Vijay

Read only

Former Member
0 Likes
966

Hello,

thank you all for you'r fast response!

I'll try to make it work when i have time!

Regards,

Simon

Read only

former_member821147
Participant
0 Likes
967

Hi,

First you declare variables in smaforms in global delcarion part and pass your input(radio button inputs) to that smartforms and then you can create window for footer and put condition in window based on above inputs got from program.

create different text for different footer texts then put condition based on inputs.

Read only

former_member212148
Participant
0 Likes
966

Hi Simon,

Declare a variable

Flag type char1.

if p_rad1 = 'X'.

FLAG = 'X'.

elseif p_rad2 = 'X'.

FLAG = 'X'.

elseif p_rad3 = 'X'.

FLAG = 'X'.

Now in condition tab of text

pass the value

flag = 'x'.


Thanks,

Ranjit Kumar