Application Development and Automation 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: 
Read only

report

Former Member
0 Likes
428

report for vendor master analysis report?

regards,

padma

3 REPLIES 3
Read only

Former Member
0 Likes
407

Hi,

The table for vendor master Data is LFA1, LFB!, LFC1 and LFBK.

LFA! - Vendor Master Data.

LFB1 - Vendor Master (Company Code).

LFC1 - Vendor master (Trans figures).

LFBK - Vendor Master Bank Details.

So from this u take the fields u require.....

U did not specify what type of report u want ....simple or complex or interactive report...

just mention that first.

Read only

Former Member
0 Likes
407

u can take tables like LFA1 , LFM1

AND what u want actually standard program....or tables for that............

Read only

Former Member
0 Likes
407

See the below program for vendor analysis details :

REPORT ZRFQ_COMP no standard page heading line-size 187 line-count 35.

&----


*&Tables

&----


Tables : ekko,

ekpo,

konp,

a016.

&----


*&Data Decleration

&----


Data : v_pos type i value 19.

Data : begin of it_rfq occurs 0,

ebeln type ekko-ebeln,

ekorg type ekko-ekorg,

lifnr type ekko-lifnr,

matnr type ekpo-matnr,

WERKS type ekpo-WERKS,

end of it_rfq.

Data : begin of it_a016 occurs 0,

ebeln type ekko-ebeln,

knumh type knumh,

end of it_a016.

Data : begin of it_a363 occurs 0,

werks type werks,

lifnr type lifnr,

matnr type matnr,

knumh type knumh,

end of it_a363.

Data : begin of it_pr_details occurs 0,

knumh type knumh,

kschl type kschl,

kbetr type kwert,

end of it_pr_details.

Data : begin of it_final occurs 0,

ebeln type ebeln,

lifnr type lifnr,

name1 type lfa1-name1,

pb00 type kbetr,

zpac type kbetr,

zb00 type kbetr,

ZIN1 type kbetr,

JEC1 type kbetr,

JHX1 type kbetr,

JMOP type kbetr,

JMX1 type kbetr,

JMX3 type kbetr,

JSEP TYPE KBETR,

JVRD type kbetr,

end of it_final.

Data : begin of it_vendorname occurs 0,

lifnr type lifnr,

name1 type lfa1-name1,

end of it_vendorname.

&----


*&Selection Screen

&----


Selection-screen: begin of block blk1 with frame title text-001.

parameters : p_matnr like ekpo-matnr obligatory.

select-options : s_ebeln for ekko-ebeln,

s_ekorg for ekko-ekorg,

s_lifnr for ekko-lifnr.

Selection-screen: end of block blk1.

&----


*&Start-of-Selection.

&----


Start-of-selection.

Select ekko~ebeln

ekko~ekorg

ekko~lifnr

ekpo~matnr

ekpo~werks

into table it_rfq

from ekko

inner join ekpo

on ekkoebeln eq ekpoebeln

where ekko~ebeln in s_ebeln

and ekko~ekorg in s_ekorg

and ekko~lifnr in s_lifnr

and ekpo~matnr eq p_matnr

and ekko~bstyp eq 'A'.

if sy-subrc eq 0.

*--> Condition number from A tables.

Perform get_connum.

*--> Getting the Pricing Details from Konp Table.

Perform get_prices.

*--> Populate Vendor Name.

Perform pop_vendor_name.

*--> Populating the Final Internal table for Report.

Perform pop_final_tab.

else.

  • message 'Purchase Document does not exist' type 'E'.

endif.

&----


*&End-of-Selection.

&----


End-of-Selection.

write 😕 sy-vline,

2 'Vendor Number',

19 sy-vline.

v_pos = 19.

loop at it_final.

write at v_pos sy-vline.

v_pos = v_pos + 1.

write at v_pos it_final-lifnr.

v_pos = v_pos + 35.

endloop.

write at: v_pos sy-vline,

/(v_pos) sy-uline.

write 😕 sy-vline,

2 'Gross Price',

19 sy-vline.

v_pos = 19.

loop at it_final.

write at v_pos sy-vline.

v_pos = v_pos + 20.

write at v_pos it_final-pb00.

v_pos = v_pos + 16.

endloop.

write at: v_pos sy-vline,

/(v_pos) sy-uline.

write 😕 sy-vline,

2 'Packing & Forward',

19 sy-vline.

v_pos = 19.

loop at it_final.

write at v_pos sy-vline.

v_pos = v_pos + 20.

write at v_pos it_final-zpac.

v_pos = v_pos + 16.

endloop.

write at: v_pos sy-vline,

/(v_pos) sy-uline.

write 😕 sy-vline,

2 'Surcharge',

19 sy-vline.

v_pos = 19.

loop at it_final.

write at v_pos sy-vline.

v_pos = v_pos + 20.

write at v_pos it_final-zb00.

v_pos = v_pos + 16.

endloop.

write at: v_pos sy-vline,

/(v_pos) sy-uline.

write 😕 sy-vline,

2 'Installation',

19 sy-vline.

v_pos = 19.

loop at it_final.

write at v_pos sy-vline.

v_pos = v_pos + 20.

write at v_pos it_final-zin1.

v_pos = v_pos + 16.

endloop.

write at: v_pos sy-vline,

/(v_pos) sy-uline.

write 😕 sy-vline,

2 'Ed cess on BED%',

19 sy-vline.

v_pos = 19.

loop at it_final.

write at v_pos sy-vline.

v_pos = v_pos + 20.

write at v_pos it_final-jec1.

v_pos = v_pos + 16.

endloop.

write at: v_pos sy-vline,

/(v_pos) sy-uline.

write 😕 sy-vline,

2 'A/P Secess set off',

19 sy-vline.

v_pos = 19.

loop at it_final.

write at v_pos sy-vline.

v_pos = v_pos + 20.

write at v_pos it_final-jhx1.

v_pos = v_pos + 16.

endloop.

write at: v_pos sy-vline,

/(v_pos) sy-uline.

write 😕 sy-vline,

2 'Basic Excise Duty',

19 sy-vline.

v_pos = 19.

loop at it_final.

write at v_pos sy-vline.

v_pos = v_pos + 20.

write at v_pos it_final-zpac.

v_pos = v_pos + 16.

endloop.

write at: v_pos sy-vline,

/(v_pos) sy-uline.

write 😕 sy-vline,

2 'A/P BED set off',

19 sy-vline.

v_pos = 19.

loop at it_final.

write at v_pos sy-vline.

v_pos = v_pos + 20.

write at v_pos it_final-jmx1.

v_pos = v_pos + 16.

endloop.

write at: v_pos sy-vline,

/(v_pos) sy-uline.

write 😕 sy-vline,

2 'Ecess % set off',

19 sy-vline.

v_pos = 19.

loop at it_final.

write at v_pos sy-vline.

v_pos = v_pos + 20.

write at v_pos it_final-jmx3.

v_pos = v_pos + 16.

endloop.

write at: v_pos sy-vline,

/(v_pos) sy-uline.

write 😕 sy-vline,

2 'Sec ED Cess on BED',

19 sy-vline.

v_pos = 19.

loop at it_final.

write at v_pos sy-vline.

v_pos = v_pos + 20.

write at v_pos it_final-jsep.

v_pos = v_pos + 16.

endloop.

write at: v_pos sy-vline,

/(v_pos) sy-uline.

write 😕 sy-vline,

2 'VAT%',

19 sy-vline.

v_pos = 19.

loop at it_final.

write at v_pos sy-vline.

v_pos = v_pos + 20.

write at v_pos it_final-jvrd.

v_pos = v_pos + 16.

endloop.

write at: v_pos sy-vline,

/(v_pos) sy-uline.

&----


*&Top-of-Page.

&----


Top-of-Page.

format color 1.

Write: 'Material Number :' color 1, p_matnr color 1.

loop at it_final.

v_pos = v_pos + 1.

v_pos = v_pos + 35.

endloop.

write at: /(v_pos) sy-uline,/ sy-vline,2 'Vendor Name'.

v_pos = 19.

loop at it_final.

write at v_pos sy-vline.

v_pos = v_pos + 1.

write at v_pos it_final-name1.

v_pos = v_pos + 35.

endloop.

write at: v_pos sy-vline,

/(v_pos) sy-uline.

&----


*& Form get_connum

&----


  • Condition number from A tables

----


form get_connum .

Select EVRTN

knumh

from a016

into table it_a016

for all entries in it_rfq

where EVRTN eq it_rfq-ebeln.

Select werks

lifnr

matnr

knumh

from a363

into table it_a363

for all entries in it_rfq

where werks eq it_rfq-werks

and lifnr eq it_rfq-lifnr

and matnr eq it_rfq-matnr.

endform. " get_connum

&----


*& Form get_prices

&----


  • Getting the Pricing Details from Konp Table.

----


form get_prices .

if not it_a016[] is initial.

select knumh

kschl

kbetr

from konp

into table it_pr_details

for all entries in it_a016

where knumh eq it_a016-knumh.

endif.

if not it_a363[] is initial.

select knumh

kschl

kbetr

from konp

appending table it_pr_details

for all entries in it_a016

where knumh eq it_a016-knumh.

endif.

endform. " get_prices

&----


*& Form pop_final_tab

&----


  • Populating the Final Internal table for Report

----


form pop_final_tab .

data : l_subrc like sy-subrc.

sort it_a016 by ebeln.

loop at it_rfq.

clear l_subrc.

read table it_a016 with key ebeln = it_rfq-ebeln

binary search.

if sy-subrc eq 0.

loop at it_pr_details where knumh eq it_a016-knumh.

it_final-ebeln = it_rfq-ebeln.

it_final-lifnr = it_rfq-lifnr.

read table it_vendorname with

key lifnr = it_rfq-lifnr.

it_final-name1 = it_vendorname-name1.

case it_pr_details-kschl.

when 'PBOO'.

it_final-pb00 = it_pr_details-kbetr.

if it_pr_details-kbetr eq 0.

clear it_final.

continue.

endif.

when 'ZPAC'.

it_final-zpac = it_pr_details-kbetr.

when 'ZB00'.

it_final-ZB00 = it_pr_details-kbetr.

when 'ZIN1'.

it_final-ZIN1 = it_pr_details-kbetr.

endcase.

endloop.

else.

l_subrc = sy-subrc.

endif.

read table it_a363 with key lifnr = it_rfq-lifnr

werks = it_rfq-werks

matnr = it_rfq-matnr.

if sy-subrc eq 0.

loop at it_pr_details where knumh eq it_a016-knumh.

it_final-ebeln = it_rfq-ebeln.

it_final-lifnr = it_rfq-lifnr.

read table it_vendorname with

key lifnr = it_rfq-lifnr.

it_final-name1 = it_vendorname-name1.

case it_pr_details-kschl.

when 'JEC1'.

it_final-JEC1 = it_pr_details-kbetr.

when 'JHX1'.

it_final-JHX1 = it_pr_details-kbetr.

when 'JMOP'.

it_final-JMOP = it_pr_details-kbetr.

when 'JMX1'.

it_final-JMX1 = it_pr_details-kbetr.

when 'JMX3'.

it_final-JMX3 = it_pr_details-kbetr.

when 'JSEP'.

it_final-JSEP = it_pr_details-kbetr.

when 'JVRD'.

it_final-JVRD = it_pr_details-kbetr.

endcase.

endloop.

elseif l_subrc ne 0.

  • continue.

endif.

append it_final.

clear it_final.

endloop.

endform. " pop_final_tab

&----


*& Form pop_vendor_name

&----


  • Populate Vendor Name

----


form pop_vendor_name .

if not it_rfq[] is initial.

Select lifnr

name1

from lfa1

into table it_vendorname

where lifnr eq it_rfq-lifnr.

endif.

endform. " pop_vendor_name

Reward Points if it is helpful

Thanks

Seshu