Using the function WRITE_FORM in a SAPScript window
hi everyone.
I need to print the texts of the SO10 transaction, in a SAPSCRIPT page, but i've not able to do so.
i have a SapScript with 2 pages: FIRST and SECOND, in the window "POINT2" of the page "FIRST", I put a "NEW-PAGE" , between an if condition, for to call the next page "SECOND".
i'm using WRITE_FORM function, in the control program, to send texts from the SO10 to the window "POINT2-1" in page "SECONDt".
now, if I make debbug to sapscript, i can see when: NEW-PAGE it's called and when the ITAB gets all the text, but in the end it doesn't print the text in the sapscript.
and if I search in the SP02 transaction, for the spool number, it only appears 1 page.
not 2 like it supose to be.
can anyone tell me what i'm doing wrong ?
this is the code that i'm using.
page: FIRST
window: POINT2
/: POSITION WINDOW
/: POSITION XORIGIN '+0' CH YORIGIN '+0' LN
/: SIZE WIDTH '+0' CH HEIGHT '+0' LN
/: BOX FRAME 10 TW
/: IF V_CONT > 5
/: NEW-PAGE
/: ENDIF
PH 2º Descripción de error : <N>&IT_PRINT-QMTXT&<><><><></> ,,&VIQMEL-QMTXT&
/: INCLUDE &IT_PRINT-QMNUM& OBJECT QMEL ID LTQM LANGUAGE 'S'
page: SECOND
window: POINT2-1
/E ELEMENT
/: &IT_TEXTO-TDLINE&
control program
DATA: IT_TEXTO LIKE STANDARD TABLE OF TLINE WITH HEADER LINE.
FORM print_form .
LOOP AT IT_TEXTO.
CALL FUNCTION 'WRITE_FORM'
EXPORTING
ELEMENT = 'ELEMENT'
WINDOW = 'POINT2-1'
EXCEPTIONS
ELEMENT = 1
FUNCTION = 2
TYPE = 3
UNOPENED = 4
UNSTARTED = 5
WINDOW = 6
BAD_PAGEFORMAT_FOR_PRINT = 7
SPOOL_ERROR = 8
CODEPAGE = 9
OTHERS = 10
IF sy-subrc <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
ENDLOOP.
ENDFORM.
<MOVED BY MODERATOR TO THE CORRECT FORUM>
Edited by: Alvaro Tejada Galindo on Apr 20, 2010 7:38 AM
Change the command line /: to some paragraph format PH or line feed /.
/E ELEMENT
PH &IT_TEXTO-TDLINE&
OR
/ &IT_TEXTO-TDLINE&
Also why are you passing the text elemnt to internal table first using READ_TEXT. It can be directly done with INCLUDE Command.
Similar Messages
-
Regarding how to use the function module *control_form* in scripts
HI friends,
Can any one tell why and where do we use the function module control_form in scripts. Can you give me a small scenario how to use in scripts.hi satish,
by using this function module we can pass the control
commands to FORM THROUGH ABAP/4 PROGRAM.
see the following example:
TABLES: kna1.
DATA: BEGIN OF it_kna1 OCCURS 0,
kunnr LIKE kna1-kunnr,
name1 LIKE kna1-name1,
ort01 LIKE kna1-ort01,
land1 LIKE kna1-land1,
END OF it_kna1.
DATA:records TYPE i,
window TYPE i value 1.
select-options:s_kunnr for kna1-kunnr.
SELECT kunnr name1 ort01 land1 FROM kna1 INTO TABLE it_kna1
where kunnr in s_kunnr.
CALL FUNCTION 'OPEN_FORM'
EXPORTING
form = 'ZSCRIPT4'
language = sy-langu.
LOOP AT it_kna1.
CALL FUNCTION 'WRITE_FORM'
EXPORTING
element = 'ELE1'
function = 'SET'
type = 'BODY'
window = 'MAIN'.
DESCRIBE TABLE it_kna1 LINES records.
IF window lt records.
window = window + 1.
CALL FUNCTION 'CONTROL_FORM'
EXPORTING
command = 'NEW-WINDOW'
EXCEPTIONS
UNOPENED = 1
UNSTARTED = 2
OTHERS = 3
ENDIF.
ENDLOOP.
CALL FUNCTION 'CLOSE_FORM'
IMPORTING
RESULT =
RDI_RESULT =
TABLES
OTFDATA =
EXCEPTIONS
UNOPENED = 1
BAD_PAGEFORMAT_FOR_PRINT = 2
SEND_ERROR = 3
SPOOL_ERROR = 4
CODEPAGE = 5
OTHERS = 6
IF SY-SUBRC <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
thanks,
raji -
Hey i hav an hp pavilion g series n i would like to kno how use the function keys without having to
hey i hav an hp pavilion g series n i would like to kno how use the function keys without having to click on the fn + function key
Hi,
You can change this in your system bios as described in the link below.
http://h10025.www1.hp.com/ewfrf/wc/document?docname=c02035108&cc=us&dlc=en&lc=en&jumpid=reg_R1002_US...
Regards,
DP-K
****Click the White thumb to say thanks****
****Please mark Accept As Solution if it solves your problem****
****I don't work for HP****
Microsoft MVP - Windows Experience -
How to use the function STRIP SILENCE on many regions at the same time?
Hi,
I am doing a projet with a lot (more thant 100) of audio regions, and I would like to use the function STRIP SILENCE on many regions at the same time (with the same parameters).
Here is what happens :
1- I select many regions (10 or so)
2- I choose the function STRIP SILENCE in the AUDIO menu
3- the window for stripping silence opens, and it tells me in it that there are 10 regions selected (if I selected 10)
4- I put my parameters, then I click OK
5- Only the first regions is done! all other regions are untouched.
So... it this a bug or a feature? What am I doing wrong? Is it really working on multiple regions at the same time? If not, how could I do that besides doing the same operations 100 times!
Could that be on the Intel bug that I see quite often ("it works on old Mac but not on Intel Mac")?
Thanks,
DanielI think the message you get saying that 10 regions have been selected is not so much a bug as an oversight ---- someone didn't check to correlate the message with the actual functionality of strip silence (i.e., will only work on one region at a time).
So the message is misleading.
I find that it's best to set up a key command to perform the strip silence function. Makes the process go faster than having to mouse around. And I rarely find that the strip silence settings for one region work well on another, so I don't mind the fact that it only works to strip one region at a time.
Sure, it would be cool if it performed the operation on multiple regions, but by using the same set of s/silence parameters for all regions there's always the chance that you might accidentally crop a region in the wrong way, meaning more time spent editing the beginning/end of those regions. -
Hello, everybody, who know how to use the function READ_TEXT
Hello , everybody, I came across a program in which there is a function READ_TEXT, what is it used for ? please specify the parameters id object
. Thank you in advance, mate.
Best regards
Frank
CALL FUNCTION 'READ_TEXT'
EXPORTING
CLIENT = SY-MANDT
id = '0207'
language = sy-langu
name = tmp_name
object = 'VBBK'
ARCHIVE_HANDLE = 0
LOCAL_CAT = ' '
IMPORTING
HEADER =
TABLES
lines = text_itab
EXCEPTIONS
id = 1
language = 2
name = 3
not_found = 4
object = 5
reference_check = 6
wrong_access_to_archive = 7
OTHERS = 8Refer this link:
http://help.sap.com/saphelp_nw04/helpdata/en/d6/0db764494511d182b70000e829fbfe/frameset.htm
READ_TEXT provides a text for the application program in the specified work areas.
The function module reads the desired text from the text file, the text memory, or the archive. You must fully specify the text using OBJECT, NAME, ID, and LANGUAGE. An internal work area can hold only one text; therefore, generic specifications are not allowed with these options.
After successful reading, the system places header information and text lines into the work areas specified with HEADER and LINES.
If a reference text is used, SAPscript automatically processes the reference chain and provides the text lines found in the text at the end of the chain. If an error occurs, the system leaves the function module and triggers the exception REFERENCE_CHECK.
Function call:
CALL FUNCTION 'READ_TEXT'
EXPORTING CLIENT = SY-MANDT
OBJECT = ?...
NAME = ?...
ID = ?...
LANGUAGE = ?...
ARCHIVE_HANDLE = 0
IMPORTING HEADER =
TABLES LINES = ?...
EXCEPTIONS ID =
LANGUAGE =
NAME =
NOT_FOUND =
OBJECT =
REFERENCE_CHECK =
WRONG_ACCESS_TO_ARCHIVE =
Export parameters:
CLIENT
Specify the client under which the text is stored. If you omit this parameter, the system uses the current client as default.
Reference field: SY-MANDT
Default value: SY-MANDT
OBJECT
Enter the name of the text object to which the text is allocated. Table TTXOB contains the valid objects.
Reference field: THEAD-TDOBJECT
NAME
Enter the name of the text module. The name may be up to 70 characters long. Its internal structure depends on the text object used.
Reference field: THEAD-TDNAME
ID
Enter the text ID of the text module. Table TTXID contains the valid text IDs, depending on the text object.
Reference field: THEAD-TDID
LANGUAGE
Enter the language key of the text module. The system accepts only languages that are defined in table T002.
Reference field: THEAD-TDSPRAS
ARCHIVE_HANDLE
If you want to read the text from the archive, you must enter a handle here. The system uses it to access the archive. You can create the handle using the function module ACHIVE_OPEN_FOR_READ.
The value '0' indicates that you do not want to read the text from the archive.
Reference field: SY-TABIX
Default value: 0
Import parameters:
HEADER
If the system finds the desired text, it returns the text header in this parameter.
Structure: THEAD
Table parameters:
LINES
The table contains all text lines that belong to the text read.
Structure: TLINE
Exceptions:
ID
The text ID specified in the parameter ID does not exist in table TTXID. It must be defined there together with the object of the text module.
LANGUAGE
The parameter LANGUAGE contains a language key that does not exist in table T002.
NAME
The parameter NAME contains the name of a text module that does not correspond to the SAPscript conventions.
Possible errors:
The field contains only blanks.
The field contains the invalid characters * or ,.
OBJECT
The parameter OBJECT contains the name of a text object that does not exist in table TTXOB.
NOT_FOUND
The system did not find the specified text module.
REFERENCE_CHECK
The text module to be read has no text lines of its own but refers to the lines of another text module. This reference chain can include several levels. For the current text, the chain is interrupted, that is, one of the text modules referred to in the chain no longer exists.
WRONG_ACCESS_ TO_ARCHIVE
The exception WRONG_ACCESS_TO_ARCHIVE is triggered if an archive is accessed using an incorrect or non-existing archive handle or an incorrect mode (that is, read if the archive is open for writing or vice versa).
Raja T -
How to use the function module ....
hi
how to use the function module ssf_function_module_name in smartformsHi..
If you are using this Function module, you can get the generated function module name of smartform dynamically. It is good progrmaming practice to get the fucntion module name dynamically because there might be some problems if you are hard coding in program.
This will return the name of the function module and then from the exporting parameters you can use the fucntion module name to pass parameters to Smartforms.
Check this link.I am expalining here how to use this function module.
https://wiki.sdn.sap.com/wiki/pages/pointstab/viewpageversion.action?pageId=36109&version=2
Calling SMARTFORMS from your ABAP program
REPORT ZSMARTFORM.
Calling SMARTFORMS from your ABAP program.
Collecting all the table data in your program, and pass once to SMARTFORMS
SMARTFORMS
Declare your table type in :-
Global Settings -> Form Interface
Global Definintions -> Global Data
Main Window -> Table -> DATA
Written by : SAP Hints and Tips on Configuration and ABAP/4 Programming
http://sapr3.tripod.com
TABLES: MKPF.
DATA: FM_NAME TYPE RS38L_FNAM.
DATA: BEGIN OF INT_MKPF OCCURS 0.
INCLUDE STRUCTURE MKPF.
DATA: END OF INT_MKPF.
SELECT-OPTIONS S_MBLNR FOR MKPF-MBLNR MEMORY ID 001.
SELECT * FROM MKPF WHERE MBLNR IN S_MBLNR.
MOVE-CORRESPONDING MKPF TO INT_MKPF.
APPEND INT_MKPF.
ENDSELECT.
At the end of your program.
Passing data to SMARTFORMS
call function 'SSF_FUNCTION_MODULE_NAME'
exporting
formname = 'ZSMARTFORM'
VARIANT = ' '
DIRECT_CALL = ' '
IMPORTING
FM_NAME = FM_NAME
EXCEPTIONS
NO_FORM = 1
NO_FUNCTION_MODULE = 2
OTHERS = 3.
if sy-subrc <> 0.
WRITE: / 'ERROR 1'.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
endif.
call function FM_NAME
EXPORTING
ARCHIVE_INDEX =
ARCHIVE_INDEX_TAB =
ARCHIVE_PARAMETERS =
CONTROL_PARAMETERS =
MAIL_APPL_OBJ =
MAIL_RECIPIENT =
MAIL_SENDER =
OUTPUT_OPTIONS =
USER_SETTINGS = 'X'
IMPORTING
DOCUMENT_OUTPUT_INFO =
JOB_OUTPUT_INFO =
JOB_OUTPUT_OPTIONS =
TABLES
GS_MKPF = INT_MKPF
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.
<b>Reward points if useful</b>
Regards
Ashu -
Layout - not recognize the element when i call the function write_form
Hi experts,
I got a layout(se71) that not recognize the element that i add in the MAIN window when i call the layout from a program.
what could it be?
i add the element in se71.
any help will be appreciated.
Michal.Hi!
the write form that u are calling should be as below....
CALL FUNCTION 'WRITE_FORM'
EXPORTING
element = 'ELEMENT'
window = 'MAIN'
EXCEPTIONS
element = 1
function = 2
type = 3
unopened = 4
unstarted = 5
window = 6
bad_pageformat_for_print = 7
spool_error = 8
codepage = 9
OTHERS = 10.
IF sy-subrc <> 0.
MESSAGE 'MAIN window not called properly'(006) TYPE 'E'.
ENDIF. " IF SY-SUBRC NE 0
in the layout see if the code there with data element is proper as...
/E ELEMENT
&var&
Also this write_form FUNCTION MODULE should be called b/w OPEN_FORM and CLOSE_FORM Function Modules.
Regards -
I am going to run tests that require an actuator to move using various types of arbitrary waveforms such as sine or square. The NI 7344 is hooked to the UMI that is going through a driver for a servo valve. The loop is analog and it is closed. I have played with some of the examples but can't get it to work. I have used the function generator VI to generate a signal but I think I am using the wrong input VI to the motion control board. When I use what I have it moves the servo and then stops. It doesn't continually generate the signal.
I would love to use the controls on the function generator vi to control frequency and amplitude ect. Any help or pointer would be helpful. Thank you in advance.Hello,
I'm not clear on exactly how you want to use the generated data but I'm assuming they will be used as your target points.
There's a built-in example for motion called 'One-Axis Contour Move.vi'. This example demonstrates how to provide your target points as 1-D array. All you need to do is to replace the input array with the output of the function generator. In order to have it run continuously, use a while loop. You can further program your application so that it'll change the waveform on the fly by monitoring the user interface but this might be little little tricky as you will need to reset the move and load the new generated points while keeping track of your current position.
I hope this helps. Let me know if you have further questions regarding this
application.
Best regards,
Yusuf C.
Applications Engineering
National Instruments -
When I use the shortcut to open a new window in safari (command N) on my Macbook Pro, I get a 404 error message from Google. How do I change where 'Command N' routes to?
It's not necessary to change the Command N keystroke..
From your Safari menu bar click Safari > Preferences then select the Privacy tab.
Click: Remove All Website Data
Then delete the cache.
Open a Finder window. From the Finder menu bar click Go > Go to Folder
Type or copy paste the following
~/Library/Caches/com.apple.Safari/Cache.db
Click Go then move the Cache.db file to the Trash.
Quit and relaunch Safari to test.
If that didn't help, troubleshoot Safari extensions.
From the Safari menu bar click Safari > Preferences then select the Extensions tab. Turn that OFF, quit and relaunch Safari to test.
If that helped, turn one extension on then quit and relaunch Safari to test until you find the incompatible extension then click uninstall. -
Error while using the function module..pack_handling_unit_dlvry
Hi all...
while using the function module pack_handling_unit_dlvry,
we need to pass the handling unit number as per the functionality we require.
but the mandatory field for the function module is the handling unit number in the form of bar code..
so how to use this function module..
All the useful answers will be regarded..
Regards,
Saroja.Have you tried using BAPI BAPI_HU_CREATE. Also view Function Module Documentation on its usage.
-
How to use the function ' CRM_INTLAY_ANALYZE_DATA '?
Hi Experts,
I am working in a scenario where I need to get the GUID of a complaint transaction even before the complaint transaction is saved.I can get that using the function 'CRM_INTLAY_GET_HEADER_GUID' .I also want to get the codegroup and the code associated with the complaint .For that I want to use the function 'CRM_INTLAY_ANALYZE_DATA'. This function has got an import parameter 'IT_ITF_CHANGED_FIELD' which is of type tabletype 'CRMT_ITF_CHANGEDFIELD_TAB' . the line type of this table type is 'CRMT_ITF_CHANGEDFIELD' .In it there is a field called 'REF_GUID' .I populate only this field using the guid returned from 'CRM_INTLAY_GET_HEADER_GUID' .
But no values are coming in the export parameter 'ET_SUBJECT' of the function.
I think I am missing something.
Please give some solution as it is very urgent.
Thanks,
Samrat DuttaHi Experts,
I am working in a scenario where I need to get the GUID of a complaint transaction even before the complaint transaction is saved.I can get that using the function 'CRM_INTLAY_GET_HEADER_GUID' .I also want to get the codegroup and the code associated with the complaint .For that I want to use the function 'CRM_INTLAY_ANALYZE_DATA'. This function has got an import parameter 'IT_ITF_CHANGED_FIELD' which is of type tabletype 'CRMT_ITF_CHANGEDFIELD_TAB' . the line type of this table type is 'CRMT_ITF_CHANGEDFIELD' .In it there is a field called 'REF_GUID' .I populate only this field using the guid returned from 'CRM_INTLAY_GET_HEADER_GUID' .
But no values are coming in the export parameter 'ET_SUBJECT' of the function.
I think I am missing something.
Please give some solution as it is very urgent.
Thanks,
Samrat Dutta -
I have a photo of an ice surface and another of a flower. Now I want to create a merged photo with the flower lying under the ice. I understand that I shall use the function "Layer" and have even read in the manual and looked on a video, but that information is not sufficiently detailed for me. I have tried several options, but I come now way. Generally it seems that your information is only for the ones who can, not for the people who can´t although it is we who really need to learn. Please give me a step by step (click by click) information on how I can get the ice above the flower and then make the ice partly transparent so the flower is seen underneath. Please send me an e-mail Erik Solbu [email protected]
Open a new document big enough for your image. Then additional open your ice and flower image as well. Copy each and paste it into your blank document. They will be placed on their own separate layers.
Make sure in your layers panel. (Bottom right) the ice is above the flower, by dragging it in place. In that same layers panel click the ice layer to select in and find the opacity meter above. Drag to the left until you get the effect you desire. -
Why can't I use the function of menu item 'issue delivery output'?
why can't I use the function of menu item 'issue delivery output' in main screen of delivery note?
And at the same time I can't use the button of printing in main screen of delivery note.
the main screen of delivery note I mean above is in screen of maintaining shipping data instand of the first screen of VL02N.
TKS in advance.Hi,
Because delivery will be having header level output and item level output. So if u try to print through main screen then system will not know whether it is header related or item related. That is the reason it is only print output at header level or item level but not in main screen.
I think u may have doubt like how billin will be issued output through Main screen. Because for billing both header and item level data are same..
Regards
Sankar -
I am using a web application that requires the use of the F7 key. Actually, to be more precise, I need the functionality that you would get on a PC if you hit Ctrl-F7 while in this web application in Firefox. I have changed the Mac's settings to allow standard use of the function keys (rather things like volume up/down, etc.) However, when I try to use Ctrl-F7 it appears to be using the function that is built into Firefox browser rather than the web application running within Firefox. (FYI, nothing happens when I try Cmd-F7 or Alt/Option-F7 either).
Leliforever, cheek you list of installed add-ons, the Ask toolbar can be installed without the users knowledge.
For checking other extensions that may cause this, follow the procedure in this link - https://support.mozilla.com/kb/Troubleshooting+extensions+and+themes -
How to use the function module 'HR_ES_FEATURE_BACKFIELD'
Hi,
How to use the function module 'HR_ES_FEATURE_BACKFIELD'?
I need the usage from both technical as well as functional point of view.
What is the use of this function module and technically how it is to be used to retrieve a feature for a particular employee.hey iam from functional side can u be little bit clear of that feature
thanks
sikindar
Maybe you are looking for
-
Everything worked fine until I paid and downloaded a program called Rad Lab that works in Photoshop Elements. I got that downloaded and then tried to open PSE and it won't open and I keep getting this error message. I've attached a screen shot of wh
-
When importing photos with the iBooks Author Gallery widget, is anyone aware of a technique for simultaneously importing the photo's description (or jpeg file name) and writing it into the iBook Author caption field for the corresponding imported pho
-
Statement.setFetchSize is not working properly
I am using setFetchSize to limit the rows returned by query. Here is Code without using setFetchSize - Statement stmt = dao.createStatement(); ResultSet rset = stmt.executeQuery("SELECT * FROM temp"); while(rset.next ()) System.out.println( rset.get
-
How to unlink text to link in indesign cs6
dear all any one tell me how to unlink text to link in indesign cs6... regards simbu_devan
-
Phone calls not showing on MyBT account
Joined BT just over 2 weeks ago and the phone calls made are not showing on MyBT account under "View your recent usage". I am on Infinity 2 which comes with free Evening and Weekend calls and would like to be able to keep a check on what calls are ma