Skip to Content
avatar image
Former Member

multiple selection of PERNR through RP_READ_INFOTYPE

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

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

1 Answer

  • avatar image
    Former Member
    Oct 17, 2008 at 06:27 AM

    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.

    Add comment
    10|10000 characters needed characters exceeded

    • Former Member Former Member

      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.