Second page not triggering in SAP script
plz help me in this too
The code below is for two pages.
Problem is that...My second page is not triggering.
In the layout
for Fist page
attributes.
page: FIRST
next page: SECOND
for second page
attributes.
page:SECOND
next page: SECOND
REPORT ZNEW1 .
TABLES: MARA.
DATA: BEGIN OF ITAB OCCURS 0,
MATNR LIKE MARA-MATNR,
ERSDA LIKE MARA-ERSDA,
ERNAM LIKE MARA-ERNAM,
LAEDA LIKE MARA-LAEDA,
END OF ITAB.
SELECT * FROM MARA INTO CORRESPONDING FIELDS OF table ITAB
WHERE VPSTA = 'K'.
CALL FUNCTION 'OPEN_FORM'
EXPORTING
*DEVICE = ' '
DIALOG = 'X'
FORM = 'ZNEWLAY1'
LANGUAGE = SY-LANGU
EXCEPTIONS
OTHERS = 1.
call function 'START_FORM'
EXPORTING
FORM = 'ZNEWLAY1'
LANGUAGE = ' '
STARTPAGE = 'FIRST'
PROGRAM = ' '
MAIL_APPL_OBJECT =
IMPORTING
LANGUAGE =
EXCEPTIONS
UNOPENED = 1
OTHERS = 2.
CALL FUNCTION 'WRITE_FORM'
EXPORTING
ELEMENT = 'HEADER'
FUNCTION = 'SET'
TYPE = 'BODY'
WINDOW = 'HEADER'
EXCEPTIONS
UNOPENED = 1
OTHERS = 2.
call function 'WRITE_FORM'
EXPORTING
ELEMENT = 'LOGO'
FUNCTION = 'SET'
TYPE = 'BODY'
WINDOW = 'LOGO'
EXCEPTIONS
UNOPENED = 4
OTHERS = 9.
LOOP AT ITAB.
CALL FUNCTION 'WRITE_FORM'
EXPORTING
ELEMENT = 'MAIN'
FUNCTION = 'SET'
TYPE = 'BODY'
WINDOW = 'MAIN'
EXCEPTIONS
UNOPENED = 1
OTHERS = 2
ENDLOOP.
CALL FUNCTION 'WRITE_FORM'
EXPORTING
ELEMENT = 'FOOTER'
FUNCTION = 'SET'
TYPE = 'BODY'
WINDOW = 'FOOTER'
EXCEPTIONS
UNOPENED = 1
OTHERS = 2.
call function 'END_FORM'
EXCEPTIONS
UNOPENED = 1
BAD_PAGEFORMAT_FOR_PRINT = 2
OTHERS = 3.
call function 'START_FORM'
EXPORTING
ARCHIVE_INDEX =
FORM = 'ZNEWLAY1'
LANGUAGE = ' '
STARTPAGE = 'SECOND'
PROGRAM = ' '
MAIL_APPL_OBJECT =
EXCEPTIONS
UNOPENED = 1
OTHERS = 2.
call function 'WRITE_FORM'
EXPORTING
ELEMENT = 'MAIN'
FUNCTION = 'SET'
TYPE = 'BODY'
WINDOW = 'MAIN'
EXCEPTIONS
UNOPENED = 1
OTHERS = 2.
call function 'END_FORM'
EXCEPTIONS
UNOPENED = 1
BAD_PAGEFORMAT_FOR_PRINT = 2
OTHERS = 3.
CALL FUNCTION 'CLOSE_FORM'
EXCEPTIONS
UNOPENED = 1
OTHERS = 2.
Hi Scientila Choudary,
Your problem will be cleared once you remove start_form and end_form as these are not necessary.we have to use start_from and end_from when we are operating on different forms.Presently we are operating on only no need to use this.
Once your problem is solved please close this.
Similar Messages
-
Calling different pages in a single sap script based on conditions?
Hi All,
Can anyone please give me an example of how to call different pages in a single sap script based on condition. Eg., i need to call 5 differnet pages from a single sap script based on 5 company codes.
Please help
Regards
PriyaThis approach to make call from SAPscript. Its concept is similar to make call to a subroutine in another program. I would presume you understand how to use USING and CHANGING parameter. =)
SAPscript -
/: Perform get_date in program z_at_date
/: using &p_year&
/: changing &new_date&
/: endperform.
program z_at_date -
form get_date TABLES rec_in STRUCTURE itcsy
rec_out STRUCTURE itcsy..
DATA:
v_year type char10.
sap script and subroutine uses itcsy structure to transmit parameters
first parameter is incoming while second parameter is out going
their function is like an internal table with header line
all data types between SAPscript and subroutine are string.
so, you might need additional conversion.
read incoming parameter with exact name from SAPscript
READ TABLE rec_in WITH KEY name = 'P_YEAR'.
IF sy-subrc EQ 0.
v_year = rec_in-value.
ENDIF.
to return value, use the exact name on the second structure
CONCATENATE v_year v_year INTO v_year.
READ TABLE rec_out WITH KEY name = 'NEW_DATE'.
IF sy-subrc EQ 0.
rec_out-value = v_year.
MODIFY rec_out TRANSPORTING value WHERE name = 'NEW_DATE'.
ENDIF.
endform.
Hope this helps =) -
Issue in New Page Display in a SAP Script
Hi All
I have applied a line count logic in my SAP script, such that if lines are more than 32, Sub Total is displayed on this page(Sub Total needs 4 lines to display) and from next page,another heading starts. (Total around 39 lines can be displayed in one page)
Sub Total Text contains 2 lines of text, and 2 blank lines after it (Total 4 lines)
Now, if number of lines is around 36, Sub Total, doesnt fully display in this page and the 2 blank lines gets passed to the next page. And I am also firing a new page from my code. As a result, the 2nd page comes fully blank and the data is now being displayed at the 3rd page. How can I prevent the 2nd page from coming blank ??
I am using Function Module 'CONTROL_FORM' (or WRITE_FORM) to fire a new page.
I do not want to apply a line count logic for this as this wont be fool proof !!
I hope I have made the issue clear. Kindly help !!
Thanks
KPHi,
otherwise u can do one thing: U call the PERFORM in the SCRIPT FORM passing the &PAGE&(Contains the current Page No) value to it. take a loal variable and pass the PAGE value to the local variable and check for every line whether both &PAGE& & local varaiable are same, if not then set the FLAG value to 'X' (it means the new page has triggered).
Eg:
In Script:
/: lv_tabix = lv_tabix + 1.
/: PERFORM new_page_flag IN PROGRAM ZXXXXX
/: USING &PAGE&
/: USING &lv_tabix&
/: CHANGING &FLAG&
In ZXXXXX Program:
FORM new_page_flag USING int_tab STRUCTURE itcsy
CHANING out_tab STRUCTURE itcsy.
data : lv_page TYPE i,
lv1_tabix TYPE i.
READ TABLE int_tab WITH KEY name = 'LV_TABIX'.
IF sy-subrc EQ '0'.
lv1_tabix = int_tab-value.
clear : int_tab.
ENDIF.
IF lv1_tabix EQ '1'.
lv_page = '1'.
ENDIF.
READ TABLE int_tab WITH KEY name = 'PAGE'.
IF lv1_tabix GT '1'.
IF lv_page NE int_tab-value.
READ TABLE out_tab WITH KEY name = 'FLAG'.
IF sy-subrc EQ 0.
out_tab-value = 'X'.
MODIFY out_tab.
clear : out_tab.
ENDIF.
ENDIF.
ENDIF.
IF sy-subrc EQ '0'.
lv_page = int_tab-value.
ENDIF.
Hope it helps!!
Rgds,
Pavan -
IF-condition not working in sap script??????
hi,
i am trying to chk one condition in sap script using if statement....but it is not working at all.
statement i am writing is :-
/: IF &IST_ITEM-SAD_PRINT& <> 0
p7 ,,,,,,,,,,,,,,,,SAD,, 4.00 &IST_ITEM-SAD_PRINT&
/: ENDIF
value for IST_ITEM-SAD_PRINT is coming as it is shown while debuging .
eventhen control is going inside if statement independent from the value of IST_ITEM-SAD_PRINT
how to use if statement properly....
regards
DeepakHi,
Declare a dummy variable of type IST_ITEM-SAD_PRINT and then use that variable in sapscript..
Ex..
<b>Print program</b>
DATA: V_DUMMY LIKE IST_ITEM-SAD_PRINT.
<b>Sap script</b>
/: IF &IST_ITEM-SAD_PRINT& <> <b>&V_DUMMY&</b>
p7 ,,,,,,,,,,,,,,,,SAD,, 4.00 &IST_ITEM-SAD_PRINT&
/: ENDIF
Thanks,
Naren -
Message type is not triggered in SAP when PO copied from eSHOP
Hi,
We are creating PO in eShop and sending to SAP.
POs are correctly getting copied from eShop to SAP.No issues.
We have set condition record for Message type to trigger in SAP for those POs as EDI Medium.
No message is getting triggering in SAP.
Whether it is standard one ? or any further enhancement required ? If so please suggest the BAPI.
ThanksHi Dhina
What is the application eSHOP?.
for example
In SAP SRM - Technical scenario - Extended Classic.
Purchase orders were created in SRM -EBP and replica of Purchase Orders were replicated to ECC system. In the above scenario messages are created in SRM not ECC.
The PO messages are out puted to vendor from SRM itself.
So please clarify what is meant by eShop. so others can help you further ..
Muthu -
Dropdown List in Second Page Not Displaying First Page's Selection
Hi,
I have two pages. The first displays an employee hierarchy. So the first page displays several employee ids. When you click Edit, the second page only displays the emp_id because of this code in my dropdown list.
e.emp_id=:P2_X_EMPDROPDOWN;
The other dropdown lists do not get populated with the previous page selection. So my questions is how do I get the dropdown lists in page 2 to display the previous page's selection. So the focus of each of the dropdown lists should highlight the previous page's selection.
Thanks in advance.If I understand your problem right, this can be the solution:
In the list of values definition of the seccond selectlist, you set this:
select e.LST_NM||' '|| e.frst_nm d, e.emp_id r
from
emp_table ethen your default value must be the Id selected on the first page. You can do this as follows:
Default Value Type is set to PL/SQL Function Body
Default value is
return :P1_X_EMPDROPDOWN; -
New Page Format implentation in Sap Scripts and Reports
Hi,
I want to print Report details and also some of the SAP Script details on the paper size of 350MM width and 310MM Height in the PORTRAIT format.
So i created new page format with these dimensions.
How i can use this for reports. So i can set these parameters while taking output from Report.
Pls specify if any configuration required for this.
Thanks in Advance,
Regards,
Pavan.In SAPscript, you set the Page Format for the document in the "Page Format" field of the "Basic Settings" page of the documents "Header" information. The popup list of this field will show all available formats in your system, so this is a ggod way to make sure your new format is set up properly.
For reports, page format is set either with the LINE-SIZE addition to the REPORT and NEW-PAGE commands, or through the PARAMETERS addition to the NEW-PAGE command. When you use LINE-SIZE the print system picks the format for you, based on the available formats in the systems.
I don't remember if there is an activation step for Page Formats, or if saving is all you have to do. -
Junk Characters on first two pages of Cheque Printing SAP Script.
Hi All
I implementing cheque printing for one of our client's Oman based subsidiary. I have copied the standard SAP Script F110_PRENUM_CHCK into a Z-Form and maintained its original language as EN. I have commented out all the unnecessary peices of information in all the windows and customised as per my requirement.
Now the problem that i am facing is that when i execute this script through the standard driver program RFFOUS_C, i am getting junk characters on first two pages of the script. The info displayed comes in the HEADER and MAIN Windows. The desired output is coming in the 3rd, 4th and 5th pages.
Please let me know how should i get rid of these junk characters.
Regards
Harsh
PS: All info printed is in English only.Hi
Thanks for your response.
Yes, the remittance advice header info is getting printed in the HEADER Window and its contents in the tabular structure are in the MAIN Window.
I am passing EN as the language.
Adding to this, the report RFFOUS_C gets executed and i am checking the spool that is created which has the junk characters on the first two pages.
Regards
Harsh -
Friends need help desperate-- Second page not printing from the beginning
Hi Friends,
I have a large layout whose main-section is 8.5x20 (Width&height) which has 2 frames each having 2 repeating frames and about 20 fields in each repeating frame. When I run the report it shows the report right, but when I print, it prints only the first half since the report is long. When I change the property of the second frame of 'Page break before' to 'yes' it prints the second frame on the second page but print it at the same position as it printed on the first, and top of second page is all blank. How do I make to print from the beginning of the second page. Need your help.
Thanks
Joe.Hello,
Most of the times, these problem are solved by "enclosing" the "Repeating frames" in frames with "Vertical Eleasticity" set to "Variable"
Regards -
In internal table having 30 columns of data.
i have to display like
first 10 columns in first page with page no :1
second 10 columns in second page with page no :2
third 10 columns in second page with page no :3
how to develop this.
please how develop this in smartforms .
please help .Hi,
You dont have to divide the data.
You must be using TABLE node in your smartform to display the table.
Copy the node 2 times more so that the total table nodes become 3.
Now, change the headings in each table according to the column you want to display.
Change the fields of the workarea in the ITEM lines accordingly.
Add a COMMAND node after each table and set it to go to next page.
E.G :
Suppose I have a table with 6 columns and I need to display 2 columns in a table then page break.
Work area name is WA.
Then first table will have headings : FIELD1 FIELD2
Items will have field : WA-FIELD1 WA_FIELD2
COMMAND NODE : Go to Next Page
Second table will have heading : FIELD3 FIELD4
Items will have field : WA-FIELD3 WA_FIELD4
COMMAND NODE : Go to Next Page
Third table will have heading : FIELD5 FIELD6
Items will have field : WA-FIELD5 WA_FIELD6
So, same table with same work area will be used 3 times, displaying different set of columns in each TABLE node.
Regards,
Ashish -
Second page not printing on EPSON dot matrix
Hi Experts,
I have created a Smart Form which has 2 pages. I am able to see the Print Preview correctly of 2 pages, (Spool also shows correctly), but when I give the print on EPSON DOT MATRIX PRINTER, only one page is getting printed. Somewhere it seems that second page is getting overlapped on the first page. Its very strange behieveour. Dont know why its happening.
Any ideas ??I have done it. Well issue was: \f command needs to be used when you create the custom page in the device type--->formats->your custom page----End of page.
In end of page simply write \f and printer will stop over writing the pages
Thanks. -
HTML Page not appearing after SAP Upgrade from 4.6c to ECC 6.0
Dear All,
I am novice in ITS and IAC configuration stuff....
Issue: We have a HTML page which shows a tree structure of Functional location and Equipments. A Z transaction is built to cater the requirement. User logs on to the HTML page navigates thru the Tree structure of Functional locations and equipments and the logs the workrequest or Break down details. In 4.6C every thing is working fine. But after Upgrade in Testing Server (We are not go live yet) we are facing a problem where the HTML page with tree structure is skipped off and directly the Z transaction is appearing on the web page.
Did any one faced such issue? Any thoughts is highly appreciable?
Thanks,
Sanjay.Thanks Frank and Dhurairaj....and sorry for the delay in responding..
I have checked my service in SICF and it is active. I also tried to create a new Service and now I am now getting "500 Connection timed out" error.
Our Z transaction is ZW03 and Service name is ZW03_2.
We are on Netweaver 7 (2004s)
Steps I followed:
1. Created a Service ZW03_2 in SICF (New Sub element) and then Activated.
default host -> SAP -> bc -> gui -> sap -> its
2. Created a folder ZW03_2 under SAP->Public->ITS (Transaction SE80, MIME Repository) and imported all MIME objects into that folder.
3. Created a Internet Service ZW03_2 in SE80. Once I created a Service already there is blank folder Topic 99. Then I created two folders Mime Objects and HTML Templates. Imported all Mime objects into folder "Mime Objects" and Created templates in "HTML Templates" folder. Then I published ..
After doing all the above setting then I tried to test the service and I am getting 500 Connection time out.
Please let me know if I missed any step or if I have done any setting incorrectly.
Thanks,
Sanjay. -
Top Of Page not triggering in ALV
Hi
I am using ALV List Disaply. I have a itab that has 2000 Rows. When i scoll down, the header appears at the top always. Now i added the following code to trigger a Top of Page Event.
FORM xevents.
CLEAR xs_event.
xs_event-name = slis_ev_top_of_page.
xs_event-form = 'XTOP_OF_PAGE'.
APPEND xs_event TO gt_xevents.
CLEAR xs_event.
ENDFORM.
FORM xtop_of_page.
BREAK-POINT.
WRITE: / 'X_TOP_OF_PAGE'.
ENDFORM.
CALL FUNCTION 'REUSE_ALV_LIST_DISPLAY'
EXPORTING
I_INTERFACE_CHECK = ' '
I_BYPASSING_BUFFER =
I_BUFFER_ACTIVE = ' '
i_callback_program = sy-repid
I_CALLBACK_PF_STATUS_SET = ' '
I_CALLBACK_USER_COMMAND = ' '
I_STRUCTURE_NAME =
is_layout = st_layout
it_fieldcat = fieldcat[]
IT_EXCLUDING =
IT_SPECIAL_GROUPS =
IT_SORT =
it_filter = filttab[]
IS_SEL_HIDE =
I_DEFAULT = 'X'
I_SAVE = ' '
IS_VARIANT =
it_events = gt_xevents
IT_EVENT_EXIT =
IS_PRINT =
IS_REPREP_ID =
I_SCREEN_START_COLUMN = 0
I_SCREEN_START_LINE = 0
I_SCREEN_END_COLUMN = 0
I_SCREEN_END_LINE = 0
IMPORTING
E_EXIT_CAUSED_BY_CALLER =
ES_EXIT_CAUSED_BY_USER =
TABLES
t_outtab = alv_tab[]
EXCEPTIONS
PROGRAM_ERROR = 1
OTHERS = 2
IF sy-subrc <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.this may be help u ....
t_gt_events type slis_t_event,
form display_alv.
v_repid = sy-repid.
sort vit_final by flag vbeln .
perform get_top_of_page using t_gt_events[].
gs_keyinfo-header01 = 'DISPO'.
gs_keyinfo-item01 = 'DISPO'.
call function 'REUSE_ALV_LIST_DISPLAY'
exporting
I_INTERFACE_CHECK = ' '
i_callback_program = v_repid
I_CALLBACK_PF_STATUS_SET = ' '
I_CALLBACK_USER_COMMAND = ' '
I_STRUCTURE_NAME =
is_layout = vfl_layout
it_fieldcat = vit_fieldcat
IT_EXCLUDING =
it_special_groups =
it_sort = vit_sort
IT_FILTER =
IS_SEL_HIDE =
I_DEFAULT = 'X'
I_SAVE = ' '
IS_VARIANT = ' '
IT_EVENTS = t_gt_events[]
IT_EVENT_EXIT =
IS_PRINT =
IS_REPREP_ID =
I_SCREEN_START_COLUMN = 0
I_SCREEN_START_LINE = 0
I_SCREEN_END_COLUMN = 0
I_SCREEN_END_LINE = 0
I_BYPASSING_BUFFER =
I_BUFFER_ACTIVE =
IMPORTING
tables
t_outtab = vit_final
exceptions
program_error = 1
others = 2.
if sy-subrc <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
endif.
endform. " DISPLAY_ALV
*& Form get_top_of_page
text
--> p1 text
<-- p2 text
form get_top_of_page using t_gt_events type slis_t_event.
data: ls_event type slis_alv_event.
call function 'REUSE_ALV_EVENTS_GET'
exporting
i_list_type = 0
importing
et_events = t_gt_events.
read table t_gt_events with key name = slis_ev_top_of_page
into ls_event.
move c_formtop to ls_event-form.
append ls_event to t_gt_events.
endform. " get_top_of_page -
How to add a page in the SAP Scripts
Hi All,
I want to know how to add a page in the sap scripts. there is already sap script developed by some other person.
Now I have to add a page in front of that and have to add some more data.I added a page in page windows but thats not at all working.
Please help me out in this.
Thanks,
Praveennew page will create in sap scripts using new page command.
you have to set condition like after some number of records displayed in page new page has to be trigger.
ex:YOU HAVE SO MANY RECORDS FOR PRINTING BUT YOU WANT TO DISPLAY 100 RECORDS IN FIRST PAGE REMAINING IN SECOND PAGE LIKE THAT.
Here you can use NEW PAGE COMMAND .
IT IS OPPOSITE PURPOSE OF PROTECT AND ENDPOTECT.
Reward if useful. -
Quick SAP Script question New Page Print
Quick SAP Script question
I have added a new page to an existing SAP Script BUT only want it to print if a condition is true.
I need to do this from within the form as the print program is SAP Std.
Any idea how I can prevent the new page from printing?
i.e. I need the form NOT to call the new page if the condition is false. Is there a way of forcing an exit or stop from with in the form?Hi,
To trigger a new page, there is script ediotr command NEW-PAGE.
so find where is that command is triggered and use the below code for trigger it on any specific condition....
if &condition& = 'True'
/* NEW-PAGE
elseif
/: NEW-PAGE
endif
so it means if condition is satisfied your new page will not work.. else it will...
Hope you got it...
Try this..
Best luck..
Regs,
Lokesh.
Maybe you are looking for
-
How do I get pdf file to open from websites?
When I click on a pdf file to open from a website, Explorer tries to open the pdf, but reloads the page then errors out. I am running XP pro with the Adobe Reader X. I have tried to uninstall reader and re-install. My registry is using the correct
-
Can I run 2 apple acounts on a single iphone
Hi There, I was just wondering if I can combine my work and personal apple accounts to run on 1 iPhone? thanks
-
Hi, I have an idoc coming from xi. The idoc gets generated in SAP but with incorrect receiver partner name and port. I do believe we fill up some mandatory fieds in xi. One thing i noted is for the logical system, the inbound parameter was not main
-
How to order a calendar and a book in one order?
I have created a book and a calendar and I want to order both in one order, so that I don´t have to pay twice the shipping fee. Iphoto 9.6.
-
Dear experts : we used DMR at characteristic level . The rule is Skip test for over 30000 batches that means we only need inspect the first batch .Every thing went well before but currently we got a new Inspection lot and the MIC in that sudde