Application Development 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: 

sapscript program

Former Member
0 Kudos

Hey everyone,

i have created a form using SAPSCRIPT in which i have two radiobuttons G_QUO(QUOTATION) & G_PRO(PROFORMA) .

Now what i want is when i click on G_QUO in one of the windows it should come as quotation invoice and when i click on G_PRO in one of the windows it should come as proforma invoice.

Rightnow both are being printed Quotation or proforma invoice.

also where do i need to make changes in my code , pl.let me know.

Thanks in advance

sanchita

1 ACCEPTED SOLUTION

0 Kudos

Hi Sanchita,

I also had same kind of requirement in which what i have done is:

In t-code NACE, i have maintained 2 different output types (G_QUO, G_PRO) with same program name and same script name.

and in driver program, I byforget both invoice types with IF condition and call respective write forms for G_QUO and G_PRO.

In your driver program should be like:

IF  nast-kschl = 'G_QUO'.

          perform open_form.

          perform start_form.

          perform write_form window element function.

          .

          .

ELSEIF nast-kschl = 'G_PRO'.

          perform open_form.

          perform start_form.

          perform write_form window element function.

          .

          .

ENDIF.



Hope this will help you out.


-Sunny

9 REPLIES 9

rosenberg_eitan
Active Contributor
0 Kudos

Hi,

For starter I suggest that for new development you use Smartform (I find Smartform to be much more programmer friendly...) .

I am assuming that you are using the same script for both forms so you have two options:

- Split the form into two and call each one based on your radio buttons.

- Use "Conditional Text: IF" in your form based on your radio buttons  .

Regards.

0 Kudos

Hey Eitan,

Thanks first of all. I too find Smartform to be much more easier to develop forms compared to scripts.

but ryt now i have to do this in script.

May i know how do i split the form into twp based on the2 radio buttons ????

0 Kudos

Hi,

Different names for:

CALL FUNCTION 'OPEN_FORM'

FORM =

Regards.

0 Kudos

okay . thanks

0 Kudos

If i use the Conditional Text 'IF' , should i write the code in my driver program se38 ?

0 Kudos

Hi Sanchita,

I also had same kind of requirement in which what i have done is:

In t-code NACE, i have maintained 2 different output types (G_QUO, G_PRO) with same program name and same script name.

and in driver program, I byforget both invoice types with IF condition and call respective write forms for G_QUO and G_PRO.

In your driver program should be like:

IF  nast-kschl = 'G_QUO'.

          perform open_form.

          perform start_form.

          perform write_form window element function.

          .

          .

ELSEIF nast-kschl = 'G_PRO'.

          perform open_form.

          perform start_form.

          perform write_form window element function.

          .

          .

ENDIF.



Hope this will help you out.


-Sunny

Former Member
0 Kudos

i have the two radiobuttons g_quo n g_pro in my driver program and if i use the IF condition to bring the output .

where n what should i write the code ?

pl specify whether to write it in my script form or in my driver program ?

0 Kudos

Hi Sanchita,

what ever you want to do with radio buttons is not possible as SAP Script/ Smartfoms are not interactive.

Only option left with you is using Output Determination by creating 2 different Output types (G_QUO and G_PRO).

-Sunny

0 Kudos

okay thanks