Sap script useful in HR-ABAP
Hi,
I want to know in What way sap script is useful in HR-ABAP.
Hi,
we can generate the remuneration statements.
Thanks & Regards
Sunil Kondoju
Similar Messages
-
My question is that How to add a report into the SAP-SCRIPT .
by using PERFORM ......ENDPERFORM
I don't know how to used it .Hi Sandeep,
Please check this link
http://help.sap.com/saphelp_40b/helpdata/en/d1/803279454211d189710000e8322d00/content.htm
http://www.allinterview.com/showanswers/37425.html
Calling ABAP Subroutines: PERFORM
You can use the PERFORM command to call an ABAP subroutine (form) from any program, subject to the normal ABAP runtime authorization checking. You can use such calls to subroutines for carrying out calculations, for obtaining data from the database that is needed at display or print time, for formatting data, and so on.
PERFORM commands, like all control commands, are executed when a document is formatted for display or printing. Communication between a subroutine that you call and the document is by way of symbols whose values are set in the subroutine.
Syntax in a form window:
/: PERFORM <form> IN PROGRAM <prog>
/: USING &INVAR1&
/: USING &INVAR2&
/: CHANGING &OUTVAR1&
/: CHANGING &OUTVAR2&
/: ENDPERFORM
INVAR1 and INVAR2 are variable symbols and may be of any of the four SAPscript symbol types.
OUTVAR1 and OUTVAR2 are local text symbols and must therefore be character strings.
The ABAP subroutine called via the command line stated above must be defined in the ABAP report prog as follows:
FORM <form> TABLES IN_TAB STRUCTURE ITCSY
OUT_TAB STRUCTURE ITCSY.
ENDFORM.
The values of the SAPscript symbols passed with /: USING... are now stored in the internal table IN_TAB . Note that the system passes the values as character string to the subroutine, since the field Feld VALUE in structure ITCSY has the domain TDSYMVALUE (CHAR 80). See the example below on how to access the variables.
The internal table OUT_TAB contains names and values of the CHANGING parameters in the PERFORM statement. These parameters are local text symbols, that is, character fields. See the example below on how to return the variables within the subroutine.
From within a SAPscript form, a subroutine GET_BARCODE in the ABAP program QCJPERFO is called. Then the simple barcode contained there (u2018First pageu2019, u2018Next pageu2019, u2018Last pageu2019) is printed as local variable symbol.
Definition in the SAPscript form:
/: PERFORM GET_BARCODE IN PROGRAM QCJPERFO
/: USING &PAGE&
/: USING &NEXTPAGE&
/: CHANGING &BARCODE&
/: ENDPERFORM
/ &BARCODE&
Coding of the calling ABAP program:
REPORT QCJPERFO.
FORM GET_BARCODE TABLES IN_PAR STUCTURE ITCSY
OUT_PAR STRUCTURE ITCSY.
DATA: PAGNUM LIKE SY-TABIX, "page number
NEXTPAGE LIKE SY-TABIX. "number of next page
READ TABLE IN_PAR WITH KEY u2018PAGEu2019.
CHECK SY-SUBRC = 0.
PAGNUM = IN_PAR-VALUE.
READ TABLE IN_PAR WITH KEY u2018NEXTPAGEu2019.
CHECK SY-SUBRC = 0.
NEXTPAGE = IN_PAR-VALUE.
READ TABLE IN_PAR WITH KEY u2018BARCODEu2019.
CHECK SY-SUBRC = 0.
IF PAGNUM = 1.
OUT_PAR-VALUE = u2018|u2019. "First page
ELSE.
OUT_PAR-VALUE = u2018||u2019. "Next page
ENDIF.
IF NEXTPAGE = 0.
OUT_PAR-VALUE+2 = u2018Lu2019. "Flag: last page
ENDIF.
MODIFY OUT_PAR INDEX SY-TABIX.
ENDFORM.
Best regards,
raam -
Sap script - using form-endform
I have used follwing code in subroutine,but in quality control this is rejected because of "structure" keyword.
FORM GET_TKNUM TABLES CT_INTAB structure ITCSY
CT_OUTTAB structure ITCSY.
IF CT_INTAB[] IS NOT INITIAL.
LOOP AT CT_INTAB INTO LV_INTAB.
READ TABLE CT_INTAB INDEX 1.
CHECK SY-SUBRC = 0.
MOVE ct_INTAB-VALUE TO LV_REQNO.
CLEAR CT_INTAB.
ENDLOOP.
ENDIF.
Then i used following code but values are not coming from script.
FORM SHIP_INFO USING CT_INTAB TYPE TABLE ITCSY
CT_OUTTAB TYPE TABLE ITCSY.
IF CT_INTAB[] IS NOT INITIAL.
LOOP AT CT_INTAB INTO LV_INTAB.
READ TABLE CT_INTAB INTO LV_INTAB INDEX 1.
CHECK SY-SUBRC = 0.
MOVE LV_INTAB-VALUE TO LV_SHIPNO.
CLEAR LV_INTAB.
ENDLOOP.
ENDIF.
what is another way to define form?Try using 'LIKE'.
LOOP AT CT_INTAB INTO LV_INTAB.
ENDLOOP.
FORM GET_TKNUM TABLES CT_INTAB LIKE ITCSY[]
CT_OUTTAB LIKE ITCSY[].
IF CT_INTAB[] IS NOT INITIAL.
READ TABLE CT_INTAB INDEX 1.
CHECK SY-SUBRC = 0.
MOVE CT_INTAB-VALUE TO LV_REQNO.
CLEAR CT_INTAB.
ENDIF.
ENDFORM
You may also refer to the below sample code from ABAP HELP. (I could not find a hyper link to it though)
TYPES: BEGIN OF FLIGHT_STRUC,
FLCARRID LIKE SFLIGHT-CARRID,
PRICE LIKE SFLIGHT-FLDATE,
END OF FLIGHT_STRUC.
DATA: MY_FLIGHT TYPE TABLE OF FLIGHT_STRUC,
IBOOK1 TYPE TABLE OF SBOOK,
IBOOK2 LIKE TABLE OF IBOOK1,
STRUC TYPE SBOOK.
PERFORM DISPLAY USING MY_FLIGHT IBOOK1 IBOOK2 STRUC.
FORM DISPLAY USING P_ITAB LIKE MY_FLIGHT[]
P_BOOK1 LIKE IBOOK1[]
P_BOOK2 LIKE IBOOK2[]
P_STRU LIKE STRUC.
DATA: L_FLIGHT LIKE LINE OF P_ITAB,
L_CARRID LIKE L_FLIGHT-FLCARRID.
WRITE: / P_STRU-CARRID, P_STRU-CONNID.
LOOP AT P_ITAB INTO L_FLIGHT WHERE FLCARRID = L_CARRID.
ENDLOOP.
ENDFORM. -
How to add new fields in sap scripts using itcsy structure
hi guys,
could u provide the screen-shots for adding field in scripts. copied standard forms .
thanks& regards
eswar.Hi,
you cannot add new fields using ITCSY. It is the interface structure between a SAPscript an a value-changing form-routine.
Need example anyway?
Good luck!
Jo -
Printing problem in Sap script using J1IP
Using a Zprogram & script for Excise Invoice printing using J1IP. The value of a field gets double while printing but it appears correct in Print Preview of the same.
Moreover, the value prints correctly if some other login is used on the same machine.
What could be the reason. Kindly advise as not able to resolve this issue.
thanks
anuHi Kumar,
Sometimes it is to do with printer settings. I hope you are checking Output for both PRD and DEV on same printer.
Sachin -
Getting Dynamic XPOS and YPOS for drawing the line in MAIN window in SAP Script using BOX command
Hi Experts,
I am trying to draw a line using the BOX command in the main window.
/: BOX HEIGHT 0 TW FRAME 10 TW INTENSITY 100
I want to draw a line in XPOS and YPOS dynamically..
Is there any way to find such I can draw a line dynamically after triggering a Text element. or determine the XPOS and YPOS dynamically such that I can draw a line in an intended position dynamically.
Thanks in Advance
Regards
Rajesh Chowdary VelagaAny update on this ??
-
ABAP Subroutines in SAP Script forms
Hi Friends,
Can any give an example on using ABAP Subroutines in SAP Scripts
how to call ABAP subroutine IN FORM and how to define form statement in abap program
thanks in advance
Points for sure
Regards
VijayaHi,
you have to write
perform formname in program zprogram
using &var1&
using &var2&
changing &var3&
endperform
in se38 create program zprogram of subroutine pool ttype
and
write the
form
endform there
egcode for a subroutne for changing the amount into indian words
PROGRAM ZFII_SR_PAYMNT_CHCK.
declaring the variables which are necessary
DATA:
G_AMOUNT TYPE PC207-BETRG, " having amount value
G_SPELL_AMOUNT(60) TYPE C, " LIKE SPELL-WORD, " amount in words
G_SPELL_AMOUNT1(60) TYPE C, " spell structure
G_WHTAX TYPE BSAK-QBSHB, "
G_QBSHB TYPE BSAK-QBSHB, " FOR COLLECTING THE WITH HOLDING TAX
G_ZUMSK TYPE BSAK-ZUMSK.
*DECLARING THE INTERNAL TABLES FOR THE OUTPUT TO BE DISPLAYED.
TYPES : BEGIN OF T_INPUT_TABLE.
INCLUDE STRUCTURE ITCSY.
TYPES : END OF T_INPUT_TABLE.
TYPES : BEGIN OF T_OUTPUT_TABLE.
INCLUDE STRUCTURE ITCSY.
TYPES: END OF T_OUTPUT_TABLE.
DATA: GWA_INPUT_TABLE TYPE T_INPUT_TABLE.
DATA: GWA_OUTPUT_TABLE TYPE T_OUTPUT_TABLE.
DATA: GIT_INPUT_TABLE TYPE STANDARD TABLE OF T_INPUT_TABLE.
DATA: GIT_OUTPUT_TABLE TYPE STANDARD TABLE OF T_OUTPUT_TABLE.
TYPES : BEGIN OF T_ITEM,
BUKRS TYPE BUKRS,
BELNR TYPE BELNR_D,
GJAHR TYPE GJAHR,
WT_WITHCD TYPE WT_WITHCD,
WT_QBSHB TYPE WT_WT1,
END OF T_ITEM,
IT_T_ITEM TYPE STANDARD TABLE OF T_ITEM.
DATA : GIT_ITEM TYPE IT_T_ITEM,
GWA_ITEM TYPE T_ITEM.
GET_SPELL_AMOUNT
FORM GET_SPELL_AMOUNT TABLES INPUT STRUCTURE ITCSY
OUTPUT STRUCTURE ITCSY. "#EC CALLED
CLEARING OFF THE VARIABLE USED IN PROGRAM.
CLEAR: G_AMOUNT,
G_SPELL_AMOUNT.
*clearing the internal tables which we have used.
CLEAR:
GIT_INPUT_TABLE,
GIT_OUTPUT_TABLE.
*REFRESHING THE INTERNAL TABLES.
REFRESH:
GIT_INPUT_TABLE,
GIT_OUTPUT_TABLE.
*initially assigning the memory vaules to our internal tables.
GIT_INPUT_TABLE[] = INPUT[].
GIT_OUTPUT_TABLE[] = OUTPUT[].
*reading the table input to get the amount value.
READ TABLE GIT_INPUT_TABLE INTO GWA_INPUT_TABLE INDEX 1.
IF GWA_INPUT_TABLE-VALUE CA 'X'.
REPLACE ALL OCCURRENCES OF 'X' IN GWA_INPUT_TABLE-VALUE WITH '0'.
ENDIF.
*THIS IS IMPORTANT PART AS IT IS CONVERTING THE
*CHARACTER FIELD INTO CURRENCY FIELD.
SHIFT GWA_INPUT_TABLE-VALUE LEFT DELETING LEADING SPACE.
TRANSLATE GWA_INPUT_TABLE-VALUE USING ', '.
CONDENSE GWA_INPUT_TABLE-VALUE NO-GAPS.
G_AMOUNT = GWA_INPUT_TABLE-VALUE.
*calling the function moudle which will
*covert amount into words (indian format ).
*i.e in crores, lakhs, thousands
DATA: L_SPELLAMOUNT(255) TYPE C,
L_ONLY(255) TYPE C.
CLEAR: L_SPELLAMOUNT, L_ONLY.
*here the amount should not be more than
99,99,99,999.99 . if it is greater than
*this amount this function module will not work
*so give the amount which is lessthan or equal to
*above said amount.
IF G_AMOUNT LT '1000000000'.
CALL FUNCTION 'HR_IN_CHG_INR_WRDS'
EXPORTING
AMT_IN_NUM = G_AMOUNT
IMPORTING
AMT_IN_WORDS = L_SPELLAMOUNT
EXCEPTIONS
DATA_TYPE_MISMATCH = 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.
ENDIF.
CONDENSE L_SPELLAMOUNT.
TRANSLATE L_SPELLAMOUNT TO UPPER CASE.
CONCATENATE L_SPELLAMOUNT 'ONLY' INTO L_ONLY SEPARATED BY SPACE.
*moivng the field name into table field.
GWA_OUTPUT_TABLE-NAME = 'G_SPELL_AMOUNT'.
*assigning the amount in words to the variable.
*the reason behind splitting the word into two parts
*is--- in the scripts the whole string is not getting
*printed. So we are splitting it into two parts so that
*it will print the whole string.
G_SPELL_AMOUNT = L_ONLY+0(60).
G_SPELL_AMOUNT1 = L_ONLY+60(60).
G_SPELL_AMOUNT = L_SPELLAMOUNT.
*MOVING THE AMOUNT IN WORDS TO FINAL WORK AREA.
MOVE G_SPELL_AMOUNT TO GWA_OUTPUT_TABLE-VALUE.
*MODIFYING THE INTERNAL TABLE FORM THE WORK AREA.
MODIFY GIT_OUTPUT_TABLE FROM GWA_OUTPUT_TABLE INDEX 1.
*FOR THE SECOND RECORD I.E FOR THE NEXT 60characters
GWA_OUTPUT_TABLE-NAME = 'G_SPELL_AMOUNT1'.
MOVE G_SPELL_AMOUNT1 TO GWA_OUTPUT_TABLE-VALUE.
MODIFY GIT_OUTPUT_TABLE FROM GWA_OUTPUT_TABLE INDEX 2.
*assigning the total output table to the memory .
OUTPUT[] = GIT_OUTPUT_TABLE[].
ENDFORM. "GET_COMPADDR
thanks & regards,
Venkatesh -
How to use Standard text in SAP SCRIPTS
Hi all,
Please tell me how can we use the standard text what we have created in SO10 with sap scripts.Hi Gaurav
You can create standard texts using the transaction SO10. Then to insert these standard texts in the SAPScript choose the menu, Insert->Text->Standard and choose the standard text that you want to choose.
Alternatively, you can display standard texts in your SAP Scripts using the command:
INCLUDE ZSTEXT OBJECT TEXT ID ST LANGUAGE EN
where ZSTEXT refers to the Standard Text name.
Reward pts if found usefull
Regards
Sathish:) -
Is it possible to use same sap script for different comp code with difflogo
I have 3 company codes. I need to use same sap script to all but each company code has different logo. I dnt want to go for 3 different sap script. Is it possible to change in coding
like this
If comp code = '100'
print ' logo1'
If comp code = '200'
print ' logo2'
If comp code = '300'
print ' logo3'
in same sapscript.If yes how ?Hi,
Yes you can do it.
In Sap Script use:-
/: If Comp code='100'
INCLUDE ZHEX-LOGO100 OBJECT TEXT ID ST LANGUAGE EN
/:Elseif comp code = '200'
INCLUDE ZHEX-LOGO200 OBJECT TEXT ID ST LANGUAGE EN
/:Else
INCLUDE ZHEX-LOGO300 OBJECT TEXT ID ST
LANGUAGE EN
/:Endif
I hope this helps,
Regards
Raju Chitale -
Email notification and SAP Script feature M0001
Hi All,
I have posted this questions in HCM forum but am posting again in ABAP forum since SAP script is related to ABAP development also. I will appreciate your help on this.
I am trying to send a notification to a distribution list whenever there is a specific Action (MASSN). I have two issues while trying to do so -
1 - I have defined the dynamic action and feature M0001 and a SAP script in SO10. I am getting the message in my inbox but with the variables from IT0000 only. In my sap script I have defined fields from IT0002/ IT0041 etc but those fields are coming as blank in my notification. Is this because I have configured dynamic action for IT0000 only. This is how my dynamic action looks like -
0000 06 1 P **SEND IF CHANGE IN MASSN -IT0000*****
0000 06 2 P T001P-MOLGA='10'
0000 06 4 P P0000-MASSN='UP'
0000 06 6 P P0000-MASSG='02'
0000 06 8 M M0001
Do I have to define these configurations for each and every infotype (that I have used in my SAP script) in table T588Z ?
2 - I want to include the position text instead of the Position no. in my notification. How can I do that? Since position text is stored in T582 table and not in P0000 or P0001.
Thank you for reading and I will appreciate your suggestions.
SanghamitraHi Kjetil,
Do you know how the problem was finally solved in your former company?
I already had a look to your post before, but for me the question is still opened. We have a corporate (non SAP) portal which users see by default when they open their browser and from where they can navigate to the SAP portal, in which we do not have single sign on.
So our users will definitely not login to the SAP Portal by themselves (nor to go to UWL, nor to display the homepage).
Maybe that an applet running on the corporate portal and doing RFC calls on the different back-ends would solve it, but I believe that might be quite a burden to develop, especially if we start talking to various non SAP systems as well. A better approach would probably be to query the portal db to look at what is in each user's UWL. But I have no idea of how the UWL data is structured in the portal and how it is updated (i.e. is the delta pull mechanism also running when a user is not logged in the portal?). I am also not sure whether there is an API in the portal to query this easily (i.e. similar to SAP_WAPI_COUT_WORKITEMS). Has anyone tried this approach before?
Cheers,
Patrick -
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 -
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. -
Avoid printing the Country name in the SAP Script
Hi All,
I am printing the address of the ship to customer in SAP script using ADDRESS and ENDADDRESS. The address is formatting based on the country code that I am passing in the COUNTRY parameter. Everything looks fine. But here my requirement is It has to display the address according to COUNTRY parameter and it should display all the part of the address except country name.
I am using the following syntax
/: ADDRESS PARAGRAPH AD LINES 7
/: NAME &IT_SOLDTO_ADDRS-NAME1&, &IT_SOLDTO_ADDRS-NAME2&
/: STREET &IT_SOLDTO_ADDRS-STRAS&
/: POBOX &IT_SOLDTO_ADDRS-PFACH& CODE &IT_SOLDTO_ADDRS-PSTL2&
/: CITY &IT_SOLDTO_ADDRS-ORT01&, &IT_SOLDTO_ADDRS-ORT02&
/: POSTCODE &IT_SOLDTO_ADDRS-PSTLZ&
/: COUNTRY &IT_SOLDTO_ADDRS-LAND1&
/: REGION &IT_SOLDTO_ADDRS-REGIO&
/: ENDADDRESS
for example if I pass COUNTRY = 'DE', it is printing country name as 'GERMANY'.
Please advise me how to avoid the country name alone from printing in the address.
It is very urgent requirement. Points will be awarded for helpful answers.
Regards,
Yellappa.Hello.
Since it's only one script, you can always do it without command address, like this:
* &IT_SOLDTO_ADDRS-NAME1& &IT_SOLDTO_ADDRS-NAME2&
* &IT_SOLDTO_ADDRS-STRAS&
* &IT_SOLDTO_ADDRS-ORT01& &IT_SOLDTO_ADDRS-ORT02&
* &IT_SOLDTO_ADDRS-PSTLZ&
If a field is not formatted as your needs, you can always convert it yourself, it's not that hard (in driver program or create a PERFORM in script).
Hope this solves your problem.
Best regards.
Valter Oliveira. -
Disadvantage of Smartform and Advantages of SAP script
Good day Gurus.,,
Can anyone please tell me the Advantages of SAP Script over Smartforms and
Disadvantages of Smartforms over SAP script.
Also is there any special scenario where only sapscript could be used but not Smartforms.
Please enlighten me....
Many thankshi,
Smartforms are came into picture in 4.6 version to overcome the disadvantages of scripts.
Disadvantages of Scripts
1.scripts are client dependent.
2.we can't add colors in scripts.
3.It is paragraph dependent.
4.In this main window is compulsory.
5.mutiple page formats are not availble.
6.we can't add background pictures.
Adavantages of smartforms
smartforms are advanced versions of sap scripts,
1.smartforms are client independent.
2.we can add colors in smartforms.
3.It is not a paragraph dependent.
4.In this main window is not compulsory.
5.mutiple page formats are possible.
6.we can add background pictures.
7. it will generate one function module when activating it.
8. total code can be written in smartforms itself.
sap scripts used to use in previous versions if they dont upgrate current version of sap then they have to use sap scripts because smartforms are not available in the previous versions. -
How to use IF Conditon in SAP Scripts?
Hi Guys,
I am having adoubt how to use IF conditon with multiple variables in SAp Scripts
for ex If a>b and a>c and a>d
Elseif b>a and b>c and b> d.
Elseif .....
endif.
How to use above example in SAP Scripts.
thanks,
Gopi.hi Gopi,
it is almost the same as normal ABAP, you only have to use & before and after the variable and the variable has to be in capitals and you have to make the line as command ( /: before the line )
IF &A& > &B& AND ...
text to print
ELSEIF ...
text to print
ENDIF.
hope this helps
ec
Maybe you are looking for
-
ServerSocket bind, bug or windows feature
I wanted to check if a TCP socket was already bound before attempting to use it. I had my own ideas, but looked for other ideas as well. While testing these other ideas I stumbled on the following issue. On Windows XP(SP3), its the work platform of c
-
hi experts, i am a starter of MDM and have a basic doubt in import manager. in the documents i study, it is given as primary table, secondary table, source table, and destination table. i am really getting a little confused with the significances of
-
After Login Business roles are getting diffrent format
Dear Experts, After upgrading when i am login getting business roles with different format like one business role is divided into 3 to 4 lines but i want that only horizontal means in single line. Any help really appreciated. Thanks & Regard
-
Disable iCloud Documents & Data?
Hi, yesterday i got my iPad Air 2 and disable Documents & Data under Settings -> iCloud. I only sync my contacts, so i disable everything there (not "contacts", but everything else). After disabling everything beside "contacts", "Documenst & Data" is
-
Question: iPhone 5 in Verizon with other carrier
Hi guys, I heard that iPhone 5 in Verizon comes right out the box UNLOCKED! actually I have iPhone 5 from Verizon, its working on different carrier, I'm on other country, but still there's no yet available LTE here, if I will go to other country that