Application Development Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 

adding vendor number in ZFBL3N

former_member333737
Active Participant
0 Kudos
490

Hello Experts,

I have made a new Transaction ZFBL3N copy of standard tcode FBL3N where I need to add the vendor(lifnr) in my output list.

I have added bseg-lifnr as my special fields.

In ZFBL3N vendor number is coming but I need to add logic for this where I need to select vendor number for document number who's account type is 'K'

As per this logic I have added the code before the CALL FUNCTION 'FI_ITEMS_DISPLAY'

I have added this code:

DATA : v_lifnr TYPE bseg-lifnr.
  LOOP AT it_pos.
    clear v_lifnr.
    SELECT SINGLE lifnr  FROM bseg INTO v_lifnr WHERE bukrs = it_pos-bukrs
                                              AND belnr = it_pos-belnr
                                              AND gjahr = it_pos-gjahr
                                              AND koart = 'K'.
    IF sy-subrc = 0.
      it_pos-u_lifnr  = v_lifnr.
    ELSE .
      CLEAR it_pos-u_lifnr.
    ENDIF.
    MODIFY it_pos TRANSPORTING u_lifnr.
*      clear it_pos.
  ENDLOOP.

but still the logic is not working when i debugged it these values are coming but not showing in output

Thanks & Regards,

Nikhil.

1 ACCEPTED SOLUTION

former_member182040
Active Contributor
0 Kudos
174

You add vendor like


CASE sos-gkart.
*       bring desc based on bsega-gkont.
    WHEN 'D'.
      SELECT SINGLE name1 INTO sos-name1 FROM kna1 WHERE kunnr
        = sos-gkont.

*       bring desc based on bsega-gkont.
    WHEN 'K'.
      SELECT SINGLE name1 INTO sos-name1 FROM lfa1 WHERE lifnr
        = sos-gkont.
*       bring desc based on bsega-gkont.
    WHEN 'S'.

      SELECT SINGLE txt20 INTO sos-name1 FROM skat WHERE saknr
        = sos-gkont AND spras = 'E' .

  ENDCASE.

7 REPLIES 7

Former Member
0 Kudos
174

Dear Nikhil,

Use BTE in standard report FBL3N for vendor/customer

search for BET in FBL3N. it work and i am also using it.

you can copy FM FI_INTERFACE_00001650 and use it.

former_member182040
Active Contributor
0 Kudos
175

You add vendor like


CASE sos-gkart.
*       bring desc based on bsega-gkont.
    WHEN 'D'.
      SELECT SINGLE name1 INTO sos-name1 FROM kna1 WHERE kunnr
        = sos-gkont.

*       bring desc based on bsega-gkont.
    WHEN 'K'.
      SELECT SINGLE name1 INTO sos-name1 FROM lfa1 WHERE lifnr
        = sos-gkont.
*       bring desc based on bsega-gkont.
    WHEN 'S'.

      SELECT SINGLE txt20 INTO sos-name1 FROM skat WHERE saknr
        = sos-gkont AND spras = 'E' .

  ENDCASE.

brad_bohn
Active Contributor
0 Kudos
174

I have made a new Transaction ZFBL3N copy of standard tcode FBL3N where I need to add the vendor(lifnr) in my output list

Why did you create a custom transaction? There are many posts on this forum as well as OSS notes that deal with extending the field catalog and display for the line item transactions. Did you check the code first and see that there are exits available?

former_member182040
Active Contributor
0 Kudos
174

SELECT SINGLE matnr ebeln ebelp lifnr shkzg INTO
  (ibseg-matnr,ibseg-ebeln,ibseg-ebelp,ibseg-lifnr,ibseg-shkzg)
  FROM bseg
  WHERE  bukrs           = bsis-bukrs AND
         gjahr           = bsis-gjahr AND
         belnr           = bsis-belnr AND
         buzei           = bsis-buzei  and
       koart              =  'K'.
   

0 Kudos
174

thanks krupa its resolved..u rock!!!

Thanks & Regards,

Nikhil.

0 Kudos
174

Did you tell your client the Z-transaction was un-necessary or did you force them to use it?

0 Kudos
174

Hi Brad,

Well yes told the client that it was unnecessary to make a ztransaction, but they wanted a zprogram for adding vendor number.

They dont want to use vendor field in std transaction. Can't help..;)

Thanks & Regards,

Nikhil.