on 10-17-2008 6:57 AM
Hi Experts,
I am using a syntax to fetch data according to PERNR.
RP_READ_INFOTYPE PERNO-LOW 0001 P0001 SDATE '20081231'.
If input will be multiple PERNR then how can i use the above syntax.
Plz help me out.
Thanks,
Ankur
Hi Ankur,
Its not possible to pass the multiple pernrs for this macro.
Are u using LDB in your prog.
Actually what is your req. exactly.
Regards,
charan.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Charan,
Thanks for quick reply.
I am using LDB PNP, actually i am preparing a report for PAYSLIP using SMARTFORMS.
So, multiple PERNR is possible in selection screen.
I have to fetch data from P0001 infotype for more than 1 PERNR.
For that i can use SELECT query for table PA0001 or it is possible with RP_READ_INFOTYPE or some other macros?.
plz guide me.
Thanks,
Ankur
If you are using LDB,
you can use macro rp_provide_from_last infty subty begda endda.
With this macro you will get only latest record for single employee.
Use this macro, between GET PERNR and END-OF-SELECTION. This will act like a loop.
Create an internal table with required fields. Everytime after the macro for each person you move data to internal table.
Hope this will help you...
But in generating payslip, why do u need multiple person's data.
They want an output for multiple Employees and in separate PDF for each employee..
Well i am fetching data inside a subroutine(perform...form) in my coding.
So GET PERNR is not working in subroutine.how can i use inside subroutine.
Do you have some other options.
plz let me know.
Plz guide me 1 more thing.
Can i use this macros in my SMARTFORMS?
Regards,
Ankur
Hi,
I did not get your requirement fully till now.
As of my understanding, you are displaying a report of the employees. On clicking of an employee, a pdf form must be generated for that employee.
If this is so, your requirement.
What is your Form(subroutine) doing.
Use GET Pernr first.
Process the record for one person.
Append data into some internal table finallly which you to display and fetch the required information for the employee which you need to send to smartform.
Then write end-of-selection.
Since it is a loop from Get pernr to End of selection. Your internal table will populated with all employees data.
Then after the end-of-selection you process the data as per ur requirement.
Hi,
plz check out my coding.
ON SELCTION-SCREEN,I have 2 pushbutton.
Now i am working for normal output.
************************Table Declaration*****************************
TABLES: sscrfields.
TABLES : PERNR,Q0008.
INFOTYPES: 0001,0008.
************************Data Declaration*****************************
DATA : begin of IT_HEAD occurs 0,
pernr LIKE pa0001-pernr, "Employee No
ename LIKE pa0001-ename, "Name Of Employee
begda LIKE pa0001-begda, "Start Date
abkrs LIKE pa0001-abkrs, "Payroll Area
bukrs LIKE pa0001-bukrs, "Company Code
werks LIKE pa0001-werks, "Personnel Area
btrtl LIKE pa0001-btrtl, "Personnel SubArea
plans LIKE pa0001-plans, "Position
end of IT_HEAD.
DATA : IT_HEADER LIKE IT_HEAD OCCURS 0 WITH HEADER LINE.
DATA : FM_NAME TYPE tdsfname.
*data: v_text(20) type c.
************************Selection Screen******************************
SELECTION-SCREEN Begin of Block A With FRAME TITLE TEXT-001.
Select-Options : PerNo FOR p0001-pernr.
Parameters : SDate LIKE hrpy_rgdir-fpbeg,
EDate LIKE hrpy_rgdir-fpend,
PayAra LIKE p0001-abkrs.
SELECTION-SCREEN BEGIN OF LINE .
SELECTION-SCREEN PUSHBUTTON 05(15) but1 USER-COMMAND CLI1.
SELECTION-SCREEN PUSHBUTTON 30(15) but2 USER-COMMAND CLI2.
SELECTION-SCREEN END OF LINE .
SELECTION-SCREEN End Of Block A.
*SELECTION-SCREEN:
PUSHBUTTON 5(15) but1 USER-COMMAND cli1,
PUSHBUTTON 30(15) but2 USER-COMMAND cli2.
*BREAK-POINT.
INITIALIZATION.
but1 = 'PDF FORMAT'.
but2 = 'FILE FORMAT'.
AT SELECTION-SCREEN.
CASE sscrfields-ucomm.
WHEN 'CLI1'.
PERFORM PDF.
WHEN 'CLI2'.
write:/ 'ok'.
PERFORM FILE.
ENDCASE.
*break-point.
*********************START-OF-SELECTION*******************************
Start-Of-Selection.
&----
*& Form FILE
&----
text
----
--> p1 text
<-- p2 text
----
form FILE.
loop at perno.
RP_READ_INFOTYPE PERNO-LOW 0001 P0001 SDATE '20081231'.
check pnp-sw-found eq 1.
*get pernr.
*provide * FROM P0001 WHERE PERNR = PERNO-LOW.
IT_HEAD-PERNR = P0001-PERNR.
IT_HEAD-ENAME = P0001-ENAME.
IT_HEAD-BEGDA = P0001-BEGDA.
IT_HEAD-ABKRS = P0001-ABKRS.
IT_HEAD-BUKRS = P0001-BUKRS.
IT_HEAD-WERKS = P0001-WERKS.
IT_HEAD-BTRTL = P0001-BTRTL.
IT_HEAD-PLANS = P0001-PLANS.
APPEND IT_HEAD.
*ENDPROVIDE.
endloop.
loop at it_head INTO IT_HEADER.
CALL FUNCTION 'SSF_FUNCTION_MODULE_NAME'
EXPORTING
FORMNAME = 'ZPS_CHOPANKI_WORKER'
VARIANT = ' '
DIRECT_CALL = ' '
IMPORTING
FM_NAME = FM_NAME
EXCEPTIONS
NO_FORM = 1
NO_FUNCTION_MODULE = 2
OTHERS = 3
.
IF SY-SUBRC <> 0.
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
start = sdate
end = edate
IMPORTING
DOCUMENT_OUTPUT_INFO =
JOB_OUTPUT_INFO = T_OTF_FROM_FM
JOB_OUTPUT_OPTIONS =
tables
it_header = IT_HEADER.
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. " FILE
Through this coding i am able to get an output for 1 employee in perno-low.(perno is input).
how can i code for employees given in range (perno-low n perno-high).
plz reply.
User | Count |
---|---|
93 | |
11 | |
11 | |
6 | |
6 | |
4 | |
3 | |
3 | |
3 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.