on 06-27-2007 7:37 PM
hi this is kumar please clarify doubts regarding scripts n smartforms please
1.diff b/w OPEN_FORM n START_FORM?
2.hw to display page numbers as a)1 of 2
b)1/2
in scripts as well in smartforms?
3.as scripts r client dependent how will u test the script in the testing server?
4.as we have protect n endprotect fr page protection in script similarly hw to make page protection in smartforms?
5.as smartforms r client independent wht is the significance of it?
6.the scenario is like this ' the out put of a form displays only the material number now i want to display the form output as material number along with the description fr the particular selected material number with out modifing the print program hw to do it?
7.the scenario is like this ' say fr example the form is having four customers fr each customer it has to print the out put at runtime some customer may have to
print more than one page like ths hw will u set it?
8.the scenario is like this ' in forms say fr example if it is having 5 pages of which each page is having 5 windows now the requirement is first two pages has to display all the five windows content n in the 3rd page the header n footer window should not print n the last 4th n 5th pages should display all the windows contained in it at runtime hw will u set it?
9.hw to debugg smartforms?
hw to call the system generated function module globally (frm development to testing servers) ?
10.wht r the uses n applications of TEMPLATES n TABLES? command lines N programe lines?
11.give me some scenarios when will we go fr subroutine in script?
12.please tell me the steps hw to do scripts n smartforms from scratch in real time?
13.hw to declare date n time fields in scripts n smartforms?
i will be very thank full fr u all if u clarify all the doubts thanks in advance
Hi Kumar,
Answering your questions:
1. Differences between open_form & start_form:
Open_form is mandatory while start_form is optional.
(ii) Open_form is used to open the layout set output. It should have a close_form, else we will face an error while running the script.Close_form ends the layout set output.
Start_form is used to start a new layout set.In case if we have more than one form then we have to use the start_form. It has to be followed by an end_form.
2. To display page numbers a 1 of 2 in case of sap scripts:
Write ur code in the footer window as shown in the example below:
This is page &page& of sapscript-formpages& of customer
= &wa_final-kunnr&
/: if &nextpage& ne 0
Continued on next page
/: else
This is the last page of customer &wa_final-kunnr&
/: endif
11.give me some scenarios when will we go fr subroutine in script?
you can use subroutine in script when we have a situation where we have to fetch address of the customer based on the customer number.
12.please tell me the steps hw to do scripts n smartforms from scratch in real time?
Development of SAP script involves:
(i)Creation of a Script.
(ii)Creation of a print program(report) to display the script.
TCodes used:
SE71 for creation of script.
SE38 for creation of the print program
(i)Create the number of pages you want in your script. ( by clicking on the tab Pages)
(ii)Create the windows you want. Main window has to be created. It is mandatory.
(iii)Create a paragraph format as per your requirement
(iv)Assign the page to be displayed first & the default paragraph format to be used in the header.
(v) Then save the script & activate it.
(vi) Create the print program through SE38.through this program you have to call the sap script created.
Hope some of your questions are answered.
Reward all the useful answers.
Regards
Sayee
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
8. You define page1 with 5 windows, page2 with 3 window(without header and footer)and page3 with all 5 windows. In the next page field of page1 give page2 and in the next field of page2 give page 3. and in the next field of page 3 give page3 itself. This means that page3 is the last page.
9. The Smartform that is created in the Development may not have the same name in the Production server. So it is always advised to use the Function Module SSF_FUNCTION_MODULE_NAME to get the Function Module name by passing the Smartform name.
DATA: fm_name TYPE rs38l_fnam.
CALL FUNCTION 'SSF_FUNCTION_MODULE_NAME'
EXPORTING
formname = 'ZSMARTFORM'
IMPORTING
fm_name = fm_name
EXCEPTIONS
no_form = 1
no_function_module = 2
OTHERS = 3.
IF sy-subrc <> 0.
MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
ENDIF.
CALL FUNCTION fm_name
EXCEPTIONS
formatting_error = 1
internal_error = 2
send_error = 3
user_canceled = 4
OTHERS = 5.
IF sy-subrc <> 0.
MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
ENDIF.
11. There can be situation where you already have the script and the customer comes with a requirement that he wants one more field to get printed on the script. In such cases you have to write the logic to get that data in the print program subroutine. And then call this subroutine in the script to write the data at desired location in the layout.
13. System declared date and time field in scripts.
&DATE& Currentdate
&DAY& Day
&MONTH& Month
&YEAR& Year
&TIME& Time of the day
&HOURS& Hours
&MINUTES& Minutes
&SECONDS& Seconds
Hope this helps.
Regards,
Kate
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
1. if you call function modules that you want to use the table work areas, enter the name of the corresponding program in the field TDPROGRAM of the structure you can enter in the OPTIONS parameter at OPEN_FORM. This definition is then valid for all program symbols up to the next CLOSE_FORM. However, you can also specify the name of the program in the PROGRAM parameter of the START_FORM function module. If you do this, it will be valid up to the next END_FORM. If this parameter is not set in START_FORM, then the setting in OPEN_FORM applies. OPEN_FORM is a mandatory FM which ends with CLOSE_FORM. You can open the new layout set using START_FORM and end it using END_FORM. Then again you can use another START_FORM to open another layout set and later close it.
You can use like
OPEN_FORM
START_FORM
END_FORM
START_FORM
END_FORM
CLOSE_FORM
2. In script use system variables &PAGE&, &NEXTPAGE& and &SAPSCRIPT-FORMPAGES& to print page, next page and Total number of pages in currently formatted layout set.
3. In the transaction SE71, enter the Form name and choose the menu, Utilities->Copy from client to copy SAPScripts from one client to another.
Use RSTXSCRP to import/export SAPScripts.
5. Smartforms are new compared to scripts. Client independency was one of the reasons for its development. We nned not copy it to the other client manually. It is automatically available in other clients.
6. You have to write the logic to retrieve the material description for the material and this can not be done in the script itself. If you dont want to modify the print program, you can create another new program and define a form which gets the material description. You can later call this form in your script using perform (giving the program name also)
Reward, if useful!!
Regards,
Kate
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
81 | |
9 | |
9 | |
7 | |
7 | |
6 | |
6 | |
6 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.