08-20-2016 5:54 AM
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
08-20-2016 7:22 AM
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
08-20-2016 7:03 AM
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.
08-20-2016 7:07 AM
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 ????
08-20-2016 7:15 AM
08-20-2016 7:19 AM
08-20-2016 11:52 AM
If i use the Conditional Text 'IF' , should i write the code in my driver program se38 ?
08-20-2016 7:22 AM
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
08-22-2016 8:52 AM
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 ?
08-22-2016 9:39 AM
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
08-22-2016 10:33 AM