Skip to Content
author's profile photo Former Member
Former Member

PRPS EBKN EBAN RELATED QUERY

HELLO SCN

i am basically create a alv report using table prps ebkn eban. please provide logic...

basically we want wbs in selection screen abd get report in pr and po related report usind these tables...

thanks and regards

rahul sinha

Add a comment
10|10000 characters needed characters exceeded

Related questions

2 Answers

  • Posted on Dec 10, 2014 at 06:01 AM

    Hi,

    you can use view V_EBKNP to get BANFN to PSPNR. So you get EBKN connected with PRPS and can read EBAN too.

    Regards,

    Klaus

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Dec 11, 2014 at 05:06 AM

    *&---------------------------------------------------------------------*

    *& Report ZPRPO

    *&

    *&---------------------------------------------------------------------*

    *&

    *&

    *&---------------------------------------------------------------------*

    REPORT ZPRPO.

    *&---------------------------------------------------------------------*

    *& Report ZPRPO

    *&

    *&---------------------------------------------------------------------*

    *&

    *&

    *&---------------------------------------------------------------------*

    **REPORT ZPRPO.

    TABLES : EKET, EBAN, EBKN, PRPS.

    TYPE-POOLS : SLIS.

    TYPES : BEGIN OF IT_EBAN,

    BANFN TYPE EBAN-BANFN,

    BNFPO TYPE EBAN-BNFPO,

    MATNR TYPE EBAN-MATNR,

    BADAT TYPE EBAN-BADAT,

    LFDAT TYPE EBAN-LFDAT,

    MENGE TYPE EBAN-MENGE,

    MEINS TYPE EBAN-MEINS,

    MATKL TYPE EBAN-MATKL,

    WERKS TYPE EBAN-WERKS,

    LGORT TYPE EBAN-LGORT,

    EBELN TYPE EBAN-EBELN,

    BEDAT TYPE EBAN-BEDAT,

    BSMNG TYPE EBAN-BSMNG,

    END OF IT_EBAN.

    DATA : WA_EBAN TYPE TABLE OF IT_EBAN.

    DATA : WA1_EBAN TYPE IT_EBAN.

    TYPES : BEGIN OF IT_EBKN,

    BANFN TYPE V_EBKNP-BANFN,

    * BNFPO TYPE V_EBKNP-BNFPO,

    POSID TYPE V_EBKNP-POSID,

    END OF IT_EBKN.

    DATA WA_EBKN TYPE TABLE OF IT_EBKN. " INITIAL SIZE 0.

    DATA WA1_EBKN TYPE IT_EBKN.

    TYPES : BEGIN OF IT_FINAL,

    PR_NOS TYPE V_EBKNP-BANFN,

    WBS_NUM TYPE V_EBKNP-POSID,

    MATERIAL TYPE EBAN-MATNR,

    END OF IT_FINAL.

    DATA : WA_FINAL TYPE TABLE OF IT_FINAL,

    WA1_FINAL TYPE IT_FINAL.

    SELECTION-SCREEN : BEGIN OF BLOCK B1 WITH FRAME TITLE TEXT-001.

    SELECT-OPTIONS : PRO_DEF FOR PRPS-PSPHI," MODIF ID EN ,

    WBS_D FOR EBKN-PS_PSP_PNR,

    PR_NO FOR EBAN-BANFN,

    PLANT FOR EBAN-WERKS,

    STR_LOC FOR EBAN-LGORT,

    PR_DAT FOR EBAN-BADAT.

    SELECTION-SCREEN : END OF BLOCK B1.

    START-OF-SELECTION.

    PERFORM GET_EBAN.

    END-OF-SELECTION.

    PERFORM PRINT.

    PERFORM PRINT_DATA.

    FORM GET_EBAN.

    * IF WBS_D IS NOT INITIAL.

    SELECT BANFN PS_PSP_PNR FROM EBKN INTO TABLE WA_EBKN WHERE PS_PSP_PNR = WBS_D.

    * SELECT BANFN FROM EBAN INTO TABLE WA_EBKN WHERE BANFN = PR_NO .

    *BANFN PS_PSP_PNR BNFPO

    IF NOT WA_EBKN[] IS INITIAL .

    SELECT BANFN BNFPO MATNR BADAT LFDAT MENGE MEINS MATKL WERKS LGORT EBELN BEDAT BSMNG FROM EBAN INTO TABLE WA_EBAN FOR ALL ENTRIES IN WA_EBKN WHERE BANFN = WA_EBKN-BANFN." and BNFPO = WA_EBKN-BNFPO..

    ELSE.

    ** MESSAGE 'WRONG ENTRY' TYPE 'E'.

    ENDIF.

    * ENDIF.

    *LEAVE LIST-PROCESSING.

    ** MESSAGE 'WRONG ENTRY' TYPE 'E'.

    * BANFN BNFPO MATNR BADAT LFDAT MENGE MEINS MATKL WERKS LGORT EBELN BEDAT BSMNG

    .

    ENDFORM.

    FORM PRINT.

    LOOP AT WA_EBKN INTO WA1_EBKN .

    WA1_FINAL-WBS_NUM = WA1_EBKN-POSID.

    WA1_FINAL-PR_NOS = WA1_EBKN-BANFN.

    APPEND WA1_FINAL TO WA_FINAL.

    ENDLOOP.

    LOOP AT WA_EBAN INTO WA1_EBAN WHERE BANFN = WA1_EBKN-BANFN.

    IF SY-SUBRC = 0.

    WA1_FINAL-MATERIAL = WA1_EBAN-MATNR.

    ENDIF.

    * ENDLOOP.

    APPEND WA1_FINAL TO WA_FINAL.

    ENDLOOP.

    ENDFORM.

    data FIELDCATALOG type SLIS_T_FIELDCAT_ALV WITH HEADER LINE.

    DATA: IT_EVENT TYPE SLIS_T_EVENT WITH HEADER LINE.

    DATA: IT_HEADING TYPE SLIS_T_LISTHEADER WITH HEADER LINE.

    *DATA: IT_SORT_SUBTOTAL TYPE SLIS_T_SORTINFO_ALV WITH HEADER LINE.

    form print_data.

    data : pos TYPE i.

    pos = pos + 1.

    FIELDCATALOG-FIELDNAME = 'WBS_NUM'.

    FIELDCATALOG-SELTEXT_L = 'WBS NUMBER'.

    FIELDCATALOG-COL_POS = pos.

    FIELDCATALOG-outputlen = 13.

    APPEND FIELDCATALOG TO FIELDCATALOG.

    FIELDCATALOG-FIELDNAME = 'PR_NOS'.

    FIELDCATALOG-SELTEXT_L = 'PR NUMBER'.

    FIELDCATALOG-COL_POS = pos.

    FIELDCATALOG-outputlen = 13.

    APPEND FIELDCATALOG TO FIELDCATALOG.

    FIELDCATALOG-FIELDNAME = 'MATERIAL'.

    FIELDCATALOG-SELTEXT_L = 'MATERIAL NUMBER'.

    FIELDCATALOG-COL_POS = 3.

    APPEND FIELDCATALOG TO FIELDCATALOG.

    ** FIELDCATALOG-FIELDNAME = 'KUNNR'.

    ** FIELDCATALOG-SELTEXT_L = 'Customer Id'.

    ** FIELDCATALOG-COL_POS = 4.

    ** APPEND FIELDCATALOG TO FIELDCATALOG.

    **

    **

    **

    **FIELDCATALOG-FIELDNAME = 'NAME1'.

    ** FIELDCATALOG-SELTEXT_L = 'Customer Name'.

    ** FIELDCATALOG-COL_POS = 5.

    ** FIELDCATALOG-outputlen = 18.

    ** APPEND FIELDCATALOG TO FIELDCATALOG.

    **

    ** FIELDCATALOG-FIELDNAME = 'AMOUNT'.

    ** FIELDCATALOG-SELTEXT_L = 'Cheque Amount'.

    ** FIELDCATALOG-COL_POS = 6.

    ** FIELDCATALOG-do_sum = 'X'.

    ** APPEND FIELDCATALOG TO FIELDCATALOG.

    CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'

    EXPORTING

    * I_INTERFACE_CHECK = ' '

    * I_BYPASSING_BUFFER = ' '

    * I_BUFFER_ACTIVE = ' '

    I_CALLBACK_PROGRAM = SY-REPID

    * I_CALLBACK_PF_STATUS_SET = ' '

    * I_CALLBACK_USER_COMMAND = ' '

    * I_CALLBACK_TOP_OF_PAGE = ' '

    * I_CALLBACK_HTML_TOP_OF_PAGE = ' '

    * I_CALLBACK_HTML_END_OF_LIST = ' '

    * I_STRUCTURE_NAME =

    * I_BACKGROUND_ID = ' '

    * I_GRID_TITLE =

    * I_GRID_SETTINGS =

    * IS_LAYOUT =

    IT_FIELDCAT = FIELDCATALOG[]

    * IT_EXCLUDING =

    * IT_SPECIAL_GROUPS =

    * IT_SORT = IT_SORT_SUBTOTAL[]

    * IT_FILTER =

    * IS_SEL_HIDE =

    * I_DEFAULT = 'X'

    * I_SAVE = ' '

    * IS_VARIANT =

    IT_EVENTS = IT_EVENT[]

    * IT_EVENT_EXIT =

    * IS_PRINT =

    * IS_REPREP_ID =

    * I_SCREEN_START_COLUMN = 0

    * I_SCREEN_START_LINE = 0

    * I_SCREEN_END_COLUMN = 0

    * I_SCREEN_END_LINE = 0

    * I_HTML_HEIGHT_TOP = 0

    * I_HTML_HEIGHT_END = 0

    * IT_ALV_GRAPHICS =

    * IT_HYPERLINK =

    * IT_ADD_FIELDCAT =

    * IT_EXCEPT_QINFO =

    * IR_SALV_FULLSCREEN_ADAPTER =

    * IMPORTING

    * E_EXIT_CAUSED_BY_CALLER =

    * ES_EXIT_CAUSED_BY_USER =

    TABLES

    T_OUTTAB = WA_FINAL[]

    * EXCEPTIONS

    * PROGRAM_ERROR = 1

    * OTHERS = 2

    .

    IF SY-SUBRC <> 0.

    * Implement suitable error handling here

    ENDIF.

    ENDFORM.

    *&---------------------------------------------------------------------*

    *& Form ALV_EVENTS

    *&---------------------------------------------------------------------*

    * text

    *----------------------------------------------------------------------*

    * -->P_0352 text

    * -->P_0353 text

    *----------------------------------------------------------------------*

    *FORM ALV_EVENTS USING NAME

    * FORM.

    *

    * CLEAR IT_EVENT.

    *

    * IT_EVENT-NAME = NAME.

    * IT_EVENT-FORM = FORM.

    *

    * APPEND IT_EVENT.

    *

    *ENDFORM. " ALV_EVENTS

    Add a comment
    10|10000 characters needed characters exceeded

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.