SAP Script - Window and box
Hello All
I have done changes to include few(3) lines in a SAP Script window. Because of those 3 lines, contents that were printed earlier are not getting printed.
The window is getting printed inside a box and it is defined as
BOX FRAME 10 TW.
Window height is 22.50 Ln,width 9.50 CM.
To rectify this should I increase the height of this window or should I define the attributes of the box
Please reply at the possible earliest.
Thanks in advance.
Check this
Setting default parameters for a box:
You can use the POSITION and SIZE commands to set default parmeters for a box.
Instead of:
/: BOX XPOS '11.21' MM YPOS '5.31' MM HEIGHT '10' MM WIDTH '20' MM INTENSITY 10 FRAME 0 TW
You can write:
/: POSITION XORIGIN '11.21' YORIGIN '5.31' MM
/: SIZE HEIGHT '2' MM WIDTH '76' MM
/: BOX FRAME 10 TW INTENSITY 10
This can be usefull if you gave several boxes that share the same parameters.
If you want to set the position realtively to the window use POSITION WINDOW
to set the position to the top/left start of the window. Then use POSITION
to set the current position relatively to the start of the Window.
Note that you uses "+" or "-" in the ORIGIN position to the set the position relatively.
/: POSITION WINDOW
/: POSITION XORIGIN '+5' MM YORIGIN '+10' MM
the position is now 5 MM from the left and 10 MM from the top of the window
NOTE: After using the position command you can move the current position
realtively to the last used position
/: POSITION XORIGIN '+10' MM YORIGIN '+20' MM
Now the position will be X = 15 and Y = 30
Drawing a line. You can draw a line by setting the Height or Weidth to 0
and add a frane. E.g. a horizontal line:
/: SIZE HEIGHT '0' MM WIDTH '200' MM
/: BOX FRAME 10 TW XPOS '11.21' MM YPOS '14.81' MM INTENSITY 100
Similar Messages
-
How to insert the style in sap-script? and in smart form?
how to insert the style in sap-script? and in smart form?
Hi..,
For SAP scripts u need to create them in SE72 ...
and u can include them in the script editor as..
/: STYLE <STYLE-NAME>
P1 text............... (*** P1 is the Paragraph format created in SE72 )
/: STYLE *
For smartforms u need to go for the transaction (tcode) SMARTSTYLES... here u can create paragraph and character formats globally...
<b>Sunil, plz do remember to close all your threads, when ur problem is solved !!</b>
reward all helpful answers,
sai ramesh -
Debugging SAP Scripts MR_PRINT and MR_REKL
Hi All,
Can anybody tell me if there is an easy way to debug the SAP Script Layoutsets MR_PRINT and MR_REKL, which are triggered through MRKO and MIRO transactions. Also I need to know how to repeat the print out of the above layouts, which are outputs of Invoice reductions and Invoice corrections.
I already tried SE71 -> Utilities -> Activate Debugger and also placing a break-point in one of the performs, I call, but I think the print program is a dynamic call and it is not stopping at the break-points.
Let me know what I am missing.
Thank you for your time,
yrkanthSorry, if it sounds dumb. But how will you put a hard breakpoint in a SAP Script? I don't hink there is a BREAK-POINT command which can be used in SAP Script? I activated the sap script debugger and am running the MRKO transaction which triggers the layoutset, but it is not stopping as it does stop for any other layouset.
The other way I tried was, to put in BREAK-POINT command in one of the performs the SAP script calls and I was able to stop at that only when I debug in Update debugging mode. This only allows me to debug the perform code but it still does not allow me to debug the script as we debug the script for PO (Purchase Order) by activating the SAP Script debugger and print previewing the PO.
Hope this helps?
I really appreciate your time.
Thank you,
yrkanth -
What are the main sap script events and their functionality and usage?
what are the main sap script events and their functionality and usage?
Hi,
Inside the Script, there are events like Top of Page, End of page etc.
Please elaborate about your requirement.
Best regards,
Prashant -
Sap script creating dynamic box problem
Hi all,
I am unable to create dynamic box in sap script.
Because the printing lines in the main window changing from one customer to another customer.
So could you please guide me how to create a dynamic box in sap script and also how to know the printing line nunber in main window.
Advance thanks for your suggestion
Regards,
Sudhakar.In script form u can write following code
/: DEFINE &MY_XPOS& = ' '
/: DEFINE &MY_YPOS& = ' '
/: DEFINE &MY_HEIGHT& = ' '
/: DEFINE &MY_WIDTH& = ' '
/: PERFORM GET_BOX_SIZE IN PROGRAM Z_MY_PROG
/: CHANGING &MY_XPOS&
/: CHANGING &MY_YPOS&
/: CHANGING &MY_HEIGHT&
/: CHANGING &MY_WIDTH&
/: BOX XPOS '&MY_XPOS' MM YPOS '&MY_YPOS' MM HEIGHT '&MY_HEIGHT' MM WIDTH '&MY_WIDTH' MM INTENSITY 10 FRAME 0 TW
In report u can write following code
Form Get_Box_Size TABLES IN_PAR STRUCTURE ITCSY
OUT_PAR STRUCTURE ITCSY.
Loop at Out_Par.
Case Out_Par-Name.
When 'MY_XPOS'.
Out_Par-Value = 100.
When 'MY_YPOS'.
Out_Par-Value = 57.
When 'MY_HEIGHT'.
Out_Par-Value = 300.
When 'MY_WIDTH'.
Out_Par-Value = 'Does it matter?'.
EndCase.
Modify Out_Par.
EndLoop.
EndForm. -
SAP-Script - Draw Table (Boxes) with variable number of lines
Hello,
I want to create a Table with Frames in a SAP-Script Form. First of all I don´t know the position of the table in the window main. It can be page 2 or 3 on top or in the middle. But i have to describe a position like
POSITION YORIGIN '12.95' CM. How can i position the table in a variable way?
And i don´t know the number of lines of the table. How can I manage to draw the correct numbers of boxes as numbers of lines exist?
Kind Regards
Carsten FuchsHi carsten,
1. Drawing GRID (just like excel, matrix)
is very cumbersome in sapscript layout.
(either dynamically, or hardcoded)
2. Moreover, the final look,
may or maynot appear as requried,.
ie. exactly with proper alignment and grid lines.
3. If the font size is required to change,
then the dynamic position also changes.
4. If the grid is supposed to go to the next page,
again the calculation and logic becomes tougher.
5. To use grid, its better to use smartform,
which provided FINE CONTROL of the grid
and its lines and width, height, style etc.
6. In sapsctip, at most we can use
UNDERLINE (_) and PIPE (|)
regards,
amit m. -
PLZ HELP SAP SCRIPT ISSUE (DYNAMIC BOX)
Hi all
I want to include a dynamic text (means number of lines can vary) inside a box .
please guide me how i can create this box whose size would be dynamic according to this text.
plz help i am not able to find ne solution
Thanx in advance
Edited by: SARABPREET CHADHA on Mar 14, 2008 11:33 AMFollowing things to be done in Driver program.
CALL FUNCTION 'READ_TEXT'
EXPORTING
ID = TEXT_ID
LANGUAGE = PRINT_LANGUAGE
NAME = TEXT_NAME
OBJECT = TEXT_OBJECT
IMPORTING
HEADER = TABLE_HEADER
TABLES
LINES = TABLE_LINES
EXCEPTIONS
ID = 01
LANGUAGE = 02
NAME = 03
NOT_FOUND = 04
OBJECT = 05
REFERENCE_CHECK = 06.
then
CALL FUNCTION 'WRITE_FORM_LINES'
EXPORTING
HEADER = TABLE_HEADER
WINDOW = WINDOW
IMPORTING
FROMPAGE = FROMPAGE " not interested ?
TABLES
LINES = TABLE_LINES
EXCEPTIONS
FUNCTION = 01
TYPE = 02
UNOPENED = 03
UNSTARTED = 04
WINDOW = 05.
and then in sap script.
/: INCLUDE &THEAD-TDNAME& OBJECT &THEAD-TDOBJECT& ID &THEAD-TDID&
/: PARAGRAPH T6 LANGUAGE
Your text will apper in sapscript.
Award points if useful... -
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 Experts
My logo is too big for my Form Window in SAP script.
How do I restrict the logo size to fit the size of the window.
Regards,Hi
IF you have imported it as graphic:
BITMAP 'LOGO' OBJECT GRAPHICS ID BMAP TYPE BCOL DPI <XXX>
Where XXX is the resolution:
Resolution with which a graphic is printed, specified in dots per inch, (dpi).
The graphic resolution controls the size of a graphic when it is printed. High resolutions produce small graphics while low resolutions produce large graphics.
If you choose default value 0, the original resolution of the imported graphic file is used.
Most printer drivers and printers support the following resolutions:
75 dpi
100 dpi
200 dpi
150 dpi
300 dpi
600 dpi
If you have imported it as std text I believe you've to re-imported it whit new resolution you need
Vasanth -
Hi All
Is it possible to print the outer line of the window in SAP script like address window, I want to print the whole address in a block. IF any body can guide me that would be great.
thanks
CHi
This will help you.
/: BOX XPOS YPOS WIDTH HEIGHT FRAME INTENSITY
/: POSITION XORIGIN YORIGIN WINDOW PAGE
/: SIZE WIDTH HEIGHT WINDOW PAGE
BOX:
WIDTH
Width of the box. Default: WIDTH value of the SIZE command.
HEIGHT
Height of the box. Default: HEIGHT value of the SIZE command.
FRAME
Thickness of frame. Default: 0 (no frame).
INTENSITY
Grayscale of box contents as %.
Example:
/: 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
Regards
Anshul -
SAP Script - Text in BOX.
Hi all,
This is the following code I have written.
/: POSITION MAIN /* name of the window */
/: BOX XPOS '0' CM YPOS '0' CM FRAME 10 TW
/: BOTTOM
/: BOX XPOS '2' CM YPOS '23.3' CM WIDTH '17' CM HEIGHT '1' CM FRAME 5 TW
p1 Conditions apply /p1 is paragraph format*/
/: ENDBOTTOM
I have a main window and I have a box at the bottom of the main window. Now I want to write the text "Conditions apply" in that box.
Can anyone please help me with this.
Regards,
Varun.Hi Varun,
Please do the following at "p1 Conditions apply /p1 is paragraph format*/":
For Normal text
/* IF Condition
/:If &EKPO-WERKS& EQ '101' '.
/* Write your text
/: &TEXT& "--Write your text
/:ENDIF.
For Include TEXT (Text maintained as Standard text):
/* --IF condition
/:If &Varible& EQ 'X'.
/* Write include text ZTEXT--Replace with ur Standard text
/: INCLUDE ZTEXT OBJECT TEXT ID ST LANGUAGE EN PARAGRAPH ST
/:ENDIF.
Hope this may help you.
Lanka -
Create SAP Script Style and link to Script
Hi,
How to create SAP Script Style through SE72...and how to implement it to Script..
Means where to implement to Script..for ex. below code is script code of ZMEDRUCK...
/: INCLUDE &T166P-TXNAM& OBJECT &T166P-TDOBJECT& ID &T166P-TDID& LANGUAGE &EKKO-SPRAS& PARAGRAPH IX
Please tell me where i use that style...
Regards.Hi.
Maybe, I think that the purpose of style is to use it with SO10.
Therefore, it doesn't use it in SAP script.
SAP script copies with SE71 and changes. -
I have a html page that loading in two edge compositions and an external custom javascript file. The javacsript file includes the bootstrapCallback so I can store references to the loaded compositions and can communicate with them. This seems to work well. The problem have is when I also try and load in a custom plugin javascript files into the edge compositions via the script window inside edge - I don't understand how this works, for example if I load in a custom javascript file into one of the compositions can only that composition use it's funcitionality? Is loading in scripts via edge script window the same as including in html document, I'm confused how the two relate, please help me understand.
I have a html page that loading in two edge compositions and an external custom javascript file. The javacsript file includes the bootstrapCallback so I can store references to the loaded compositions and can communicate with them. This seems to work well. The problem have is when I also try and load in a custom plugin javascript files into the edge compositions via the script window inside edge - I don't understand how this works, for example if I load in a custom javascript file into one of the compositions can only that composition use it's funcitionality? Is loading in scripts via edge script window the same as including in html document, I'm confused how the two relate, please help me understand.
-
SAP SCRIPT SO10 and Email Notification for different actions
I am working on a SAP Script now to send a notification whenever there is a Prehire ,New Hire or Termination scenario. I am a functional SAP person and need some help in one of the scenarios.
The notification seems to work fine except for two things -
I am able to get the values for MASSN (Action) and MASSG (reason code) but not the text. For e.g. I am able to get 01 with reason code 02. Action 01 is New Hire activation and reason code 02 is Addition. I want these text in my notification. How can I get it ?
Secondly , we do a Prehire action when the employee accepts the offer. We just create IT0000, IT0001 , IT0041 and IT0002. But the employee stays in INACTIVE status untill new hire activation action is done. When I do a Prehire action, I am able to get only IT0000 related data ie. MASSN and MASSG but not position or emp group etc. Why it is not giving me the IT0001 related info ? Here is what my SO10 text looks like now --
Action on &sy-datum&
/: DEFINE &CHANGEDON& = &P0000-AEDTM&
/: DEFINE &USER& = &P0000-UNAME&
/: DEFINE &ACTION& = &P0000-MASSN&
/: DEFINE &REASONCODE& = &P0000-MASSG&
/: DEFINE &FIRSTNAME& = &P0002-VORNA&
/: DEFINE &LASTNAME& = &P0002-NACHN&
/: DEFINE &HIREDATE& = &P0041-DAT01&
/: DEFINE &PERSAREA& = &P0001-WERKS&
/: DEFINE &EMPGROUP& = &P0001-PERSG&
/: DEFINE &ACTIONTEXT& = &T5885-DTEXT&
/: DEFINE &PERNR& = &P0000-PERNR&
/: DEFINE &POSITION& = &P0001-PLANS&
/: PERFORM EXT_TEXT IN PROGRAM ZHR_RETR_TXT
/: USING &PERNR&
/: CHANGING &POSITION&
/: ENDPERFORM
L THIS IS TO NOTIFY YOU THAT EMPLOYEE &PERNR&,&FIRSTNAME& &LASTNAME& WAS HIRED
ON &CHANGEDON& BY &USER& FOR &ACTION& WITH &REASONCODE&
/ THE ORIGINAL HIRE DATE (START DATE) OF THIS EMPLOYEE IS &HIREDATE&.
THIS EMPLOYEE WAS HIRED AS &POSITION& FOR &PERSAREA& AS A &EMPGROUP&.
I will appreicate your help.
SanghamitraHI,
Please have a look at the following doc:
http://www.renet-web.net/2009/07/23/automated-emails-in-sap-solution-manager-made-easy/
U may need to make some minor modifications to get ur requirement. I hope u will be able to do that once u go through this.
Rajeev. -
SAP Script : Date is Boxes ??
Dear All,
I wanted to print date in boxes. i,e MM DD YY in boxes.
I am doing like this.
/: SET DATE MASK = 'MM.DD.YY'
and then playing with Box Command, to draw vertical lines in between DD, MM and YY... with
BOX HEIGHT '0.5' CM FRAME 10 TW
BOX XPOS '.48' CM WIDTH 0 TW HEIGHT '0.5' CM FRAME 10 TW
BOX XPOS '.78' CM WIDTH 0 TW HEIGHT '0.5' CM FRAME 10 TW
Is this a right method ?? or Else
Should there be a Standard method to print Date in Boxes ..
Please let me know ...
Thanks
Regards
venkat.Hi
I think it is correct approach.
here is some more details
To define the formatting of date fields, use the SET DATE MASK control command. Executing this command causes all subsequent date fields to be printed using the specified format.
Syntax:
/: SET DATE MASK = 'date_mask'
In the date mask, you can use the following codes:
· DD: day (two digits)
· DDD: day name - abbreviated
· DDDD: day name - written out in full
· MM: month (two digits)
· MMM: month name - abbreviated
· MMMM: month name - written out in full
· YY: year (two digits)
· YYYY: year (four digits)
· LD: day (formatted as for the L option)
· LM: month (formatted as for the L option)
· LY: year (formatted as for the L option)
All other characters found in a date mask are interpreted as simple text and are copied straight into the output.
Assuming the current system date is March 1st, 1997.
/: SET DATE MASK = 'Foster City, MM/DD/YY'
&DATE& -> Foster City, 03/01/97
/: SET DATE MASK = 'MMMM DD, YYYY'
&DATE& -> March 01, 1997
The date mask may be reset to the default setting by using an empty string:
/: SET DATE MASK = ' '
The abbreviated and full forms of the names of the days and months are stored in the language dependent TTDTG table under the following keys:
· %%SAPSCRIPT_DDD_dd: abbreviated day name
· %%SAPSCRIPT_DDDD_dd: full form of day name
· %%SAPSCRIPT_MMM_mm: abbreviated month name
· %%SAPSCRIPT_MMMM_mm: full form of month name
dd: day number 01 = Monday,..., 07 = Sunday
mm: month number 01 = January,..., 12 = December
regards
vinod
Maybe you are looking for
-
No longer able to print from wireless MacBook Pro to wired C7280
I originally piggy-backed this onto an existing thread thinking that it was the same issue. It looks like it was something else now, so I figured I probably ought to spin this off onto its own thread. Details: Printer: Photosmart C7280 All-in-One,
-
Problem with Time Machine, running Snow Leopard
Hi all, Last week I had a new hard drive fitted into my iMac 8,1, after which Snow Leopard was reloaded (10.6.3 from the disc, updated to 10.6.8), followed by the restoration of data via Time Machine from my external hard drive. Whilst my Mac is now
-
Hi Experts, From one of the repository; the data is syndicated from MDM to ECC around 20,000 records on a particular date. On that particular date only few records got updated i.e. around 20. When we checked the Logs, Connections & Report we could no
-
Hi, I have another query running slow when executed from cognos. It is also not returning any output continues to execute, with "Union15" as ( select distinct CASE WHEN(substr(to_char(FLOOR("EES_ENERGY_MASTER"."DISC_MON"/100)), 1, 4) IS NULL) OR (cas
-
Grant access to specfic schema
Is there any way that these permissions could be created without the ANY clause? CREATE ANY CONTEXT DROP ANY CONTEXT EXECUTE ANY PROCEDURE EXECUTE ANY TYPE I got access to only one schema ..Client side DBA are not permitting access to "ANY" clause bu