Quantcast
Channel: SCN: Message List
Viewing all articles
Browse latest Browse all 8623

purchase document

$
0
0

Hello gurus,

 

i created all code my output is also coming when i giving input

 

but i stuck in vendor number

 

when i giving input vender number that time all vender will be display

 

my requirment is when i giving 1 vendor num and that time only 1 vender information will display not all

 

here,s is my code below,

 

 

   SELECT bukrs  "Company Code

         belnr  "Accounting Document Number

         gjahr  "Fiscal Year

         blart  "Document type

         bldat  "Document Date in Document

         budat  "Posting Date in the Document

         tcode  "Transaction Code

         xblnr  "Reference Document Number

         awkey  "Object key

  FROM bkpf

  INTO CORRESPONDING FIELDS OF TABLE it_bkpf

  WHERE bukrs = p_bukrs

  AND   belnr IN s_belnr

  AND   gjahr = p_gjahr

  AND   tcode IN ('MIRO', 'FB60', 'MR8M')

  AND   budat IN s_budat.

 

   IF sy-subrc <> 0.

* Display message: No records found

*    MESSAGE i016.

     STOP.

*  ENDIF.

   ENDIF.

ENDFORM.                    " f_get_bkpf_data

 

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

*&      Form  f_get_bseg_data

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

*       Get Accounting document segment data

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

FORM f_get_bseg_data .

 

 

   IF it_bkpf IS NOT INITIAL.

     SELECT bukrs "Company Code

            belnr "Accounting Document Number

            gjahr "Fiscal Year

            buzei "Number of Line Item Within Accounting Document

            buzid "Identification of the Line Item

            bschl "Posting key

            koart "Account type

            shkzg "Debit/Credit Indicator

            mwskz "Sales Tax Code

            qsskz "Withholding Tax Base Amount

            ktosl " Transaction type

            hkont "G/L Account

            dmbtr "Amount in local currency

            txbhw "Original Tax Base Amount in Local Currency

            sgtxt "Item Text

            lifnr "Account Number of Vendor or Creditor

            zfbdt "Baseline date for due date calculation

            zbd1t "Cash discount days 1

            zbd2t "Cash discount days 2

            zbd3t "Net Payment Terms Period

            rebzg "Number of the Invoice the Transaction Belongs to

            werks "Plant

            kostl

            prctr

            ebeln

*           lifnr

     FROM bseg

     INTO TABLE it_bseg

     FOR ALL ENTRIES IN it_bkpf

     WHERE   bukrs = p_bukrs

     AND   belnr = it_bkpf-belnr

     AND   ( mwskz IN p_mwskz OR mwskz EQ ' ' )

     AND   gjahr = p_gjahr

       AND lifnr = s_lifnr.

 

 

 

     IF sy-dbcnt = 0.

* Display message: No records found

*      MESSAGE i016.

*      STOP.

     ELSE.

       SORT it_bseg BY belnr ASCENDING.

*      DELETE ADJACENT DUPLICATES FROM it_bseg.

     ENDIF.

 

   ENDIF.

 

***  IF p_mwskz IS NOT INITIAL.   "Tax code details

***    DELETE it_bseg WHERE mwskz <> p_mwskz.

***  ENDIF.

 

ENDFORM.                    " f_get_bseg_data

 

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

*&      Form  f_get_bset_data

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

*       Get Tax data

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

FORM f_get_bset_data .

 

*  DATA : li_bset TYPE STANDARD TABLE OF ty_bset.

 

   IF it_bseg IS NOT INITIAL.

 

     SELECT bukrs "Company Code

            belnr "Accounting Document Number

            gjahr "Fiscal Year

            buzei "Number of Line Item Within Accounting Document

            mwskz "Sales Tax Code

            txgrp "Group Indicator for Tax Line Items

            shkzg "Debit/Credit Indicator

            fwbas "Tax Base Amount in Local Currency

            hwste "Tax Amount in Local Currency

            ktosl "Transaction Key

            kschl "Condition type

            kbetr

     FROM bset

     INTO TABLE it_bset

     FOR ALL ENTRIES IN it_bseg

     WHERE bukrs = p_bukrs

     AND   belnr = it_bseg-belnr

     AND   mwskz IN p_mwskz

     AND   gjahr = p_gjahr.

     IF sy-subrc EQ 0.

*      SORT it_bset BY bukrs belnr gjahr kschl shkzg .

*      LOOP AT it_bset INTO wa_bset.

*        IF wa_bset-shkzg = 'H'.

*          wa_bset-hwste = wa_bset-hwste * ( -1 ).

*        ENDIF.

*        COLLECT wa_bset INTO li_bset.

*        CLEAR wa_bset.

*      ENDLOOP.

*      CLEAR it_bset.

*      li_bset = it_bset.

     ENDIF.

   ENDIF.

 

ENDFORM.                    " f_get_bset_data

 

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

*&      Form  f_get_lfa1_data

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

*       Get Vendor data

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

FORM f_get_lfa1_data .

 

   IF it_bseg IS NOT INITIAL.

 

     SELECT lifnr "Account Number of Vendor or Creditor

            name1 "Name

     FROM lfa1

     INTO TABLE it_lfa1

     FOR ALL ENTRIES IN it_bseg

     WHERE lifnr = it_bseg-lifnr.                                                        ""this is my condition fetch vender information"""""

*     WHERE "bukrs = p_bukrs

        "belnr = it_bseg-belnr

*       lifnr = s_lifnr.

*      and "gjahr = p_gjahr.

     IF sy-dbcnt <> 0.

     ENDIF.

   ENDIF.

 

ENDFORM.                    " f_get_lfa1_data

 

FORM f_get_J_1IMOVEND_data .

 

IF it_bseg IS NOT INITIAL.

 

     SELECT lifnr "Account Number of Vendor or Creditor

            J_1ILSTNO "Vat Number

     FROM J_1IMOVEND

     INTO TABLE it_J_1IMOVEND

     FOR ALL ENTRIES IN it_lfa1

     WHERE lifnr = it_lfa1-lifnr.

 

     IF sy-dbcnt <> 0.

     ENDIF.

   ENDIF.

 

ENDFORM.

 

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

*&      Form  f_get_t053_data

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

*       Get Purchase code data

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

FORM f_get_t053_data .

 

   IF it_bseg IS NOT INITIAL.

 

     SELECT spras "Language Key

            kurzt "Text key

            langt "Long Text

     FROM t053

     INTO TABLE it_t053

     FOR ALL ENTRIES IN it_bseg

     WHERE spras = sy-langu

     AND   langt = it_bseg-sgtxt.

 

     IF sy-subrc <> 0.

     ENDIF.

 

   ENDIF.

ENDFORM.                   





where is my mistake

what should i do?


pls help me sir,



Regards,

Prathmesh Rane.


Viewing all articles
Browse latest Browse all 8623

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>