Regarding passing table array to sap scripts - urgent
Hi Experts,
I am calling an SAP Script form from a custom program. The code snippet is as follows:
MOVE : 'ZFRM_EX_COM_INV' TO w_form.
PERFORM open_form USING w_form.
PERFORM write_form USING 'MAIN' 'HEADER'.
PERFORM write_form USING 'MAIN' 'LINE_ITEM'.
LOOP AT it_cond INTO wa_cond.
<b>PERFORM write_form USING 'TOTAL' 'TOTAL_COND'.</b>
<i> " TOTAL is the page window and TOTAL_COND is the element.</i>
ENDLOOP.
PERFORM close_form.
*& Form write_form
text
-->VAR1 text
FORM write_form USING var1 var2.
IF var2 IS INITIAL.
CALL FUNCTION 'WRITE_FORM'
EXPORTING
window = var1
EXCEPTIONS
element = 1
function = 2
type = 3
unopened = 4
unstarted = 5
window = 6
bad_pageformat_for_print = 7
OTHERS = 8.
ELSE.
CALL FUNCTION 'WRITE_FORM'
EXPORTING
element = var2
window = var1
EXCEPTIONS
element = 1
function = 2
type = 3
unopened = 4
unstarted = 5
window = 6
bad_pageformat_for_print = 7
OTHERS = 8.
ENDIF.
ENDFORM. " WRITE_FORM
In the text that is in bold in teh code snippet, I am tring to pass the values one-by-one and print in the output.
But only the last line item from that table is begining printed. The other lines are overwritten by the last line.
How should I display all the lines in the internal table it_cond.
Please help me...
regards,
arul jothi a.
U are using a variable window to print the 'total_cond' text element..
so whenever u call the write form for a variable window .. it will get over written by the current contents.. I t wont append the contents to the form...
Instead u use this text element in the MAIN window then onli u will get all the data..
i hope this is the problem..
reward if it helps u...
sai ramesh
Similar Messages
-
How to pass tables data from SAP script to the routine.
Hi,
I have standard program RPCTEAL0_01 which calls a SAP script form(Custom) to print the form.
Now I have to add some additional functionality to change the values in the form. Since it is custom form I can add ROUTINE and then pass the values to the custom program to modify the variables.
My concern here, I would like to pass the tables like RT,CRT to the custom program via form.
Is this possible? RT and CRT filled by standard progam.
Regarsd
Eswar
<MOVED BY MODERATOR TO THE CORRECT FORUM>
Edited by: Alvaro Tejada Galindo on Jan 20, 2009 9:06 AMHi, The suggested option is not working.
Actually I am using the below code in SCRIPT
/: PERFORM CAL_2008 IN PROGRAM ZHR_TEST1
/: USING &PER_NO&
/: CHANGING &W12&
/: ENDPERFORM
and calling form in ZHR_TEST1. But this will pass only variables. Now my requirement is to pass tables also. -
Sap script '' how to create table frame in sap script"""
i have some problem in sap script'' how to create table frame in sap script"""
Hi,
you can use BOX command..
Syntax
/: BOX [XPOS] [YPOS] [WIDTH] [HEIGHT] [FRAME] [INTENSITY]
Effect: draws a box of the specified size at the specified position.
Parameters: For each of XPOS, YPOS, WIDTH, HEIGHT and FRAME both a measurement and a unit of measurement must be specified. The INTENSITY parameter should be specified as a percentage between 0 and 100.
1. XPOS, YPOS: Upper left corner of the box, relative to the values of the POSITION command.
Default: Values specified in the POSITION command.
The following calculation is performed internally to determine the absolute output position of a box on the page:
X(abs) = XORIGIN + XPOS
Y(abs) = YORIGIN + YPOS
2. WIDTH: Width of the box. Default: WIDTH value of the SIZE command.
3. HEIGHT: Height of the box. Default: HEIGHT value of the SIZE command.
4. FRAME: Thickness of frame.
Default: 0 (no frame).
5. INTENSITY: Grayscale of box contents as % .
Default: 100 (full black)
Measurements: Decimal numbers must be specified as literal values (like ABAP numeric constants) by being enclosed in inverted commas. The period should be used as the decimal point character. See also the examples listed below.
Units of measurement: The following units of measurement may be used:
TW (twip)
PT (point)
IN (inch)
MM (millimeter)
CM (centimeter)
LN (line)
CH (character).
The following conversion factors apply:
1 TW = 1/20 PT
1 PT = 1/72 IN
1 IN = 2.54 CM
1 CM = 10 MM
1 CH = height of a character relative to the CPI specification in the layout set header
1 LN = height of a line relative to the LPI specification in the layout set header
/: BOX FRAME 10 TW
Draws a frame around the current window with a frame thickness of 10 TW (= 0.5 PT).
/: BOX INTENSITY 10
Fills the window background with shadowing having a gray scale of 10 %.
/: BOX HEIGHT 0 TW FRAME 10 TW
Draws a horizontal line across the complete top edge of the window.
/: BOX WIDTH 0 TW FRAME 10 TW
Draws a vertical line along the complete height of the left hand edge of the window.
/: BOX WIDTH '17.5' CM HEIGHT 1 CM FRAME 10 TW INTENSITY 15
/: BOX WIDTH '17.5' CM HEIGHT '13.5' CM FRAME 10 TW
/: BOX XPOS '10.0' CM WIDTH 0 TW HEIGHT '13.5' CM FRAME 10 TW
/: BOX XPOS '13.5' CM WIDTH 0 TW HEIGHT '13.5' CM FRAME 10 TW
Draws two rectangles and two lines to construct a table of three columns with a highlighted heading section.
check the fallowing link also
http://help.sap.com/saphelp_40b/helpdata/en/d1/803293454211d189710000e8322d00/content.htm
Mark the points if u find it useful...
Regards,
Omkar. -
How to create table in the sap script
Hi,
How to create a table in the sap script layout, i Have to use table in the main window with 7 columns. can any one send sample code.
How to calculate the number of line items which are displaying in the main window, if the number of line items are exceed in the main window then the amount has to be calculate and print as "BALANCE FORWARD" and the next page had to be displayed as "CARRY FORWARD" that amount. if this is the last page not subsequent page the amount had to be calculated the carry forward amount and total amount and print as "TOTAL AMOUNT". i am creating the new layout and the program is the standrad driver program i have to use and i have to use the standard Text elements only, can any one help me on this issuehi
good
there is no "pattern" option in SAPscript. All you have at your disposal are the following SAPscript commands: BOX, POSITION and SIZE. Not only are these commands both confusing and tedious to implement, they also are limited in what they can achieve. For instance, although you can suppress a box during printout (by making it conditional), there is no simple way to adjust it dynamically instead. Thus, to divide sequential line items, you may wish to use an underline (ULINE) or simply white space.
thanks
mrutyun -
Data passing from abap to SAP Scripts
Hi all,
I am facing a problem while passing the data from abap progrm to sap scripts.
I have designed asap script which contains the main window and the text elements.
I have to print the line item in the text element 'LINE_ITEM'
the following :
&wa_bseg-belnr& ,, &wa_bseg-wrbtr&.
In the abap code :
I have data in my internal table,
I have used the write_form
ELEMENT = 'ITEM_LINE'
FUNCTION = 'APPEND'
TYPE = 'BODY'
WINDOW = 'MAIN'
But When i execute the pgm my data is not disaplyed in the print.
What could be the reason,.
Please help me soon
Regards,
Priyahi can u check once the text element name in abap code and script main window 's text element name.it must be same
in script u have to give like this
\E LINE_ITEM
in program
u have to pass the parameters
ELEMENT = 'LINE_ITEM'
FUNCTION = 'APPEND'
TYPE = 'BODY'
WINDOW = 'MAIN'
reward points if useful.
Thanks,
Usha -
EXPERTS PLZ HELP ME IN SAP SCRIPT URGENT
Hi experts
plz help me
i m very new in sap scripts
i have a script WESCHEINVERS1 and the driver prog is SAPM07DR
i ill have to copy this script and have to add two more feild in the text element W1LGMAT
fields are :
CAWNT-ATWTB
EKPO-REVLV
now wat i think i cannot make changes to standard driver prog so it wud be better to call a subroutine 4 it
so plz guide me how i ill have to fetch data nd pass to the script
plz write the code if possible 4 u
FYI:
MSEG : Document Segment Material
MANDT Client
MBLNR Number of material Document
MJAHR Material Document Year
ZEILE Item in Material Document
MATNR Material Number
LIFNR Account number or vendor
EBELN Purchase order number
EBELP Item number of PO
EKPO : Purchasing document item
MANDT Client
EBELN Purchase order number
EBELP Item number of PO
MATNR Material Number
REVLV Revision Level
LFA1 : Vendor Master (General section)
MANDT Client
LIFNR Account number of vendor or creditor MSEG-LIFNR
SPRAS Language key
AUSP : Characteristic Values
MANDT Client
OBJEK Key of object to be classified MSEG-MATNR
ATINN Internal characteristic ZO-QUALITY-LEVEL
ATZHL Internal counter
ATWRT Characteristic Value
CAWNT : Value texts
MANDT Client
ATINN Internal characteristic ZO-QUALITY-LEVEL
ATZHL Internal counter AUSP-ATZHL
SPRAS Language Key LFA1-SPRAS
ATWTB Characteristic Value Description
thanks in advanceRefer the links to know about calling subroutines ins cript -
subroutine in script
How to call a subroutine in a script ?
EXTERNAL SUBROUTINE IN SAP SCRIPT
Regards,
Amit
Reward all helpful replies. -
Regarding the Cheque printing in SAP Script. Issue with Layout Change.
I have to modify the layout of a predeveloped script.
The issue with the existing one is that, the Labels (on the window, that is printed) and the data (corresponding to it) are not on the same line.
To be more clear, I have like this on the cheque,
Payee : _______________________
Amount : ____________________
The Data corresponding to the Pay & Amount is not in the respective line (as I shown above).
How can I get that both on the same line.?
Shall I need to modify the layout or what else to do ?
Pls. guide me.
Your guidance is appreciable.
Edited by: ravikanth seal on Mar 9, 2011 5:09 AM
Edited by: ravikanth seal on Mar 9, 2011 5:10 AMHi niraj gadre ..
Ur idea may not workout fir me.
My idea is :
Can I use any formating options in the corresponding window's text elements..
Pressing F9 on the windiw (in the Windows list) displays the Text Elements (Goto Edit-> Text Elemets on the Window chosen) in the Windows list.
Here can we do any formating options, so as to change the layout alignment of window's Text Elements ??
Guide me please.
Your guidance is Appreciable
Thanks.
Edited by: ravikanth seal on Mar 9, 2011 7:55 AM -
Logo upload in SAP SCRIPT(urgent)
can any one tell me transaction in sap to UPLOAD a logo in sap and how to include in sapscript.
Hi,
You can UPLOAD your logo directly in SE78.
SE78>Graphics>BMAP grid screen. click on it.
give ur logo name .bmp file.
or in SE38 run prog:RSTXLDMC there you need to give your logo name saved as .tiff file in your desktop.
Thanks.
Message was edited by: Deepak333 k -
How can create a table in sap script?
Hi,
How to create a table in the sap script.i Have to use table in the main window with 11 rows and 3 columns. can any one send sample code. Any ideas?¿
THKS 4all.Try and check on the below logic....
1. write -
2. write headings with '|' at start and end as well as the field separator.
3. write -
4. similar to step two write the data with pipe separators.
5. write -
regards
Anurag -
Dyanamic table is SAP Script with horizontal and vertical lines
Hi,
I need to display the data of the table in the SAP script which is having both horiziontal and vertival lines.
the out put needs to looks as it in Excel...where there are multiple records with 5 fixed coulmns each seprated from one another by horizonalt and vertical lines..
I thinking about useing the Box with XPOS and YPOS who value changes dynamicaaly..
But again as the number of pages might be more than one..i think there will issues,
Can you let me know how to proceed in SCRIPT ,,,, where the number of records might vary ..and also ..it might continue to second page..
Regards
Senthilwell it is possible but quite tricky.
All you got in SAP-SCRIPT to achieve this is the BOX-Statement.
The BOX statement works with variables for XPOS, YPOS, WIDTH and HEIGHT. what you need to do is:
- calculate those variables during runtime
- add box-statements with those variables.
to calculate those variables you need to count used lines and so on. i hope i showed you a way, rest is a lil brainwork then.
regards -
Multiple line issue in sap script
Hi All,
There is a window in the sap script.
The window consists of a text element and i am displaying 4 lines of text in that window.
Sap script:
/E Reason
AC &LINE&
In the source code, an internal table will have 5 text lines and those 5 lines should be reflected in sap script.
The source code as follows.....
loop at li_tline.
CALL FUNCTION 'TEXT_SYMBOL_SETVALUE'
EXPORTING
NAME = 'LINE'
VALUE = li_tline-tdLINE.
CALL FUNCTION 'WRITE_FORM'
EXPORTING
ELEMENT = 'REASON'
WINDOW = 'REASON'
function = 'APPEND'.
endloop.
In final output, the last line of the internal table is reflacting..... Hope its getting over written each time in the loop.
How to make the code, so that i can reflect all the lines from internal table to the sap script....??????????????
Please help me, as this issue is very much urgent..........
Regards
PavanHi
Do like this.
declare 5 variables each of 80 char length.
data: v1(80), v2(80), v3(80), v4(80), v5(80).
Read the Internal table li_tline with index and move each line to different variables and write those variables in the script.
if not li_tline[] is initial.
read table li_tline index 1.
if sy-subrc = 0.
v1 = li_tline-tdline+0(80).
endif.
read table li_tline index 2.
if sy-subrc = 0.
v2 = li_tline-tdline+0(80).
endif.
read table li_tline index 3.
if sy-subrc = 0.
v3 = li_tline-tdline+0(80).
endif.
read table li_tline index 4.
if sy-subrc = 0.
v4 = li_tline-tdline+0(80).
endif.
read table li_tline index 5.
if sy-subrc = 0.
v5 = li_tline-tdline+0(80).
endif.
endif.
write the &V1& &V2& &V3& &V4& &V5& variables ins cript
Reward points if useful
Regards
Anji -
Dump error when clicked on text elements in SAP Script window
Hi All,
There is an inclusion in SAP Script. I have written the code in driver program. I need to pass the value to SAP Script in the requested position. But when I go to SE71 > Form Name > Change or Display > MAIN Window > Text Elements > I get a dump error.
Category ABAP Programming Error
Runtime Errors DATA_LENGTH_TOO_LARGE
Except. CX_SY_RANGE_OUT_OF_BOUNDS
ABAP Program SAPLSTXK
Application Component BC-SRV-SCR
Date and Time 30.04.2014 20:00:08
Short text
Invalid partial field access: Length is too large
What happened?
Error in the ABAP Application Program
The current ABAP program "SAPLSTXK" had to be terminated because it has
come across a statement that unfortunately cannot be executed.
What can you do?
Note down which actions and inputs caused the error.
To process the problem further, contact you SAP system
administrator.
Using Transaction ST22 for ABAP Dump Analysis, you can look
at and manage termination messages, and you can also
keep them for a long time.
Error analysis
An exception occurred that is explained in detail below.
The exception, which is assigned to class 'CX_SY_RANGE_OUT_OF_BOUNDS', was not
caught in
procedure "TOKEN_COMMENT" "(FORM)", nor was it propagated by a RAISING clause.
Since the caller of the procedure could not have anticipated that the
exception would occur, the current program is terminated.
The reason for the exception is:
In the executed program "SAPLSTXK", the system attempted to access the field
"ITF_TOKEN" of the type "C" and with the length 255 using the length 272.
However, a partial field access with a length specification that is
larger than the field length is not allowed.
How to correct the error
Reduce the length used to access the field.
If the error occures in a non-modified SAP program, you may be able to
find an interim solution in an SAP Note.
If you have access to SAP Notes, carry out a search with the following
keywords:
"DATA_LENGTH_TOO_LARGE" "CX_SY_RANGE_OUT_OF_BOUNDS"
"SAPLSTXK" or "LSTXKFRN"
"TOKEN_COMMENT"
If you cannot solve the problem yourself and want to send an error
notification to SAP, include the following information:
1. The description of the current problem (short dump)
To save the description, choose "System->List->Save->Local File
(Unconverted)".
2. Corresponding system log
Display the system log by calling transaction SM21.
Restrict the time interval to 10 minutes before and five minutes
after the short dump. Then choose "System->List->Save->Local File
2937 * todo empty comment ???
2938 if g_tm_open eq true or " Section
2939 g_tm_b_close eq true.
2940 l_token = '\chcbpat0'.
2941 l_len = strlen( l_token ).
2942 token_control = true.
2943 assign l_token to <itf1>.
2944 perform put_itf1_new using l_len.
2945 perform token_line_begin changing l_next_token.
2946 else. " without section
2947 concatenate '\chcbpat0\line' g_cf_string l_cbpat_token into l_token.
2948 l_len = strlen( l_token ).
2949 token_control = true.
2950 assign l_token to <itf1>.
2951 perform put_itf1_new using l_len.
2952 endif.
2953 elseif l_next_token-code eq ')L'. " \par
2954 l_token = '\par'.
2955 l_len = strlen( l_token ).
2956 token_control = true.
2957 assign l_token to <itf1>.
2958 perform put_itf1_new using l_len.
2959 elseif l_next_token-code eq '(C' or " \par + format
2960 l_next_token-code eq ')C' or
2961 l_next_token-code eq '(&' or
2962 l_next_token-code eq 'TA' or
2963 l_next_token-code eq 'SC' or
2964 l_next_token-code eq 'ST'.
2965 concatenate '\chcbpat0\par' g_pf_string g_cf_string l_cbpat_token into l_token.
2966 l_len = strlen( l_token ).
>>>>> itf_token(l_len) = l_token.
2968 token_control = true.
2969 assign l_token to <itf1>.
2970 perform put_itf1_new using l_len.
2971 endif.
2972
2973 * Step 7: (L to disarm
2974 if g_compose eq true and
2975 l_next_token-code eq '(L'.
2976 perform read_next_itf_token(rstxscan) using p_token.
2977 endif.
2978
2979 ENDFORM. " token_comment
2980 *&---------------------------------------------------------------------*
2981 *& Form create_lang_info
2982 *&---------------------------------------------------------------------*
2983 * add default language to rtf
2984 *----------------------------------------------------------------------*
2985 * -->P_HEADER text
2986 * <--P_RESULT text
How do I open the text elements? I need to pass the variable inside SAP Script.
Please Help. The requirement is pending from very long. Not able to rectify this issue.
Regards,
RekhaHi,
There is a SAP Note about this problem
566794 - Runtime error: STRING_OFFSET_TOO_LARGE during conversion
Correction Instructions
Correction Instructions
Software Component
Valid from
Valid to
Number
SAP_BASIS
46B
46D
473267
SAP_BASIS
610
620
473185
Support Packages & Patches
Support Packages
Software Component
Release
Support Package
SAP_BASIS
46B
SAPKB46B48
46C
SAPKB46C39
46D
SAPKB46D28
610
SAPKB61027
620
SAPKB62014
Regards
Miguel -
hi guys,
if i need to develop a report for purchase order using SAP script..how can that be possible???what is the name of the SAP script and how can we find that script???
regards
kalpanaHi Kalpana,
The standard SAP Script form for PO is MEDRUCK,
If You want to modify that form means take a copy of that form and modify it.
The print program for MEDRUCK is SAPFM06P.
You can get this Print programs from TNAPR table.
Have you ever worked in VK01 transaction or created an IDOC. If Yes,it will be easy to print the form.
with regards,
Kalpanashri Rajendran -
Program variable used in sap script
Hi all,
I am trying to use program variable in sapscript with format &wa_ekpo-ematn&. I am sure in the program the field wa_ekpo-ematn has a value. But when I trying to call function write_form. All the text is displayed but all the program symbol just like &wa_ekpo-ematn& are missing.Anyone can tell me how to include program variable into sapscript? Thanks a lot.
Edited by: Alex Zhang on May 26, 2009 5:08 AMHi Alex,
Can you be a bit clear, how are you passing &wa_ekpo-ematn& to SAP Script in driver program(could be helpful if u can paste piece of code) and Where do you want to print &wa_ekpo-ematn& (I mean in which Window, with what element) in SAP Script (how).
Is that totally customizied Script or Standard Script made to Customized.
Regards,
Suneel G -
Problem in SAP Script Printing
Hi All,
We are having a very strange problem while passing the data in SAP Script.Actually we are doing the Script of Payment Advice(FI/CO),but while calling the Function Module 'RSPO_RID_SPOOLREQ_LIST' in the driver program the values are lost.I have debugged it but right after the execution of 'RSPO_RID_SPOOLREQ_LIST' when the spool is generated, the variables are lost with the data they contain!!!As a result nothing are coming in Payment Advice Script.
Can anyone plz help me out!!!
Thx in advance.
Regds.
Atrai.Hi,
You have to ensure that its called only in case of print and not otherwise and may be this piece of code helps:
check tab_ausgabe-spoolnr ne space.
refresh up_list.
up_list-id = tab_ausgabe-spoolnr.
append up_list.
call function 'RSPO_RID_SPOOLREQ_LIST'
exporting
id_list = up_list[]
exceptions
others = 0.
Regards,
Satya
Maybe you are looking for
-
Not asked where to place the application
The install process assumes that the purchased application is be in the the /Applications folder. IMHO, that folder is not for 3rd party applications - I move applications that install themselves there to another folder and if the apps refuse to run
-
PLS help me about file access!!
now the file struct is like the bellow: <root>/db db.db <root>/server RemoteDataImp.java how to write the code in RemoteDataImp.java to access file db.db?? the code writen bellow is wrong! dataWrapper = new Data("../db/db.db");
-
Unable to view microsoft office files (2011) with quick view and cover flow
I am unable to view office for mac 2011 files in quick view or cover flow. All I see is the generic icon and not the preview. I've searched a number of forums but haven't found a solution. Thanks
-
Is there a way to convert videos taken in Photo Booth to iMovie?
A friend of mine came to visit from out of town and we made some videos using Photo Booth. I tried to drag and drop it into iMovie, because I need to edit some clips, but it wouldn't work. I tried dragging it to iTunes first, but then it only recogni
-
i am trying to do a windows repair for windows xp on a compaq mini cq10 101sa but after pressing f8 to except the license agreement it tells me windows can not find a hard drive and cant continue