Table for Vendor Master Email ID
Hello,
Can you please tell me the table where Vendor Email ID is stored and also how to connect it from LFA1-ADRNR in ECC 6.0?
Thanks,
Venu
adr6-addrnumber
use select statement like this.
select addrnumber into addr from adr6 as a inner join lfa1 as b on aaddrnumber = badrnr.
Similar Messages
-
Upload program for vendor master
Hi Friends,
Could you please help me in this.
actually i have a program like this:
i have to download the data from an excel sheet and reformat it and output into a text file so that the data can be uploaded into vendor master using standard progarm
<b>"RFBIKR00".</b>
i have written the program like this:
but in the middle when formatting the data...i'm facing the problem....
plz help me in solving that...
thnx very very much...........
the program i wrote is like this:
<b>
tables: lfa1,
lfb1,
lfm1,
lfbk,
bnka,
bgr00,
blf00,
blfa1,
blfb1,
blfbk,
blfm1,
blfb5,
blfbw,
blfei,
blfza,
blflr,
blfm2,
bwyt3,
bwyt1,
blfat.
*--- Internal table for spread sheet.
data: t_filedata like alsmex_tabline occurs 0 with header line.
*--- Internal table for Vendor Master Data in Spread Sheet.
data: begin of t_sheet occurs 0,
name1 like lfa1-name1, "vendor name1
name2 like lfa1-name2, "vendor name2
altkn like lfb1-altkn, "previous master record number
bukrs like lfb1-bukrs, "company code
ekorg like lfm1-ekorg, "purchase organization
ktokk like lfa1-ktokk, "account group
stras like lfa1-stras, "street
street4 like lfa1-name4, "street4
pfach like lfa1-pfach, "po box
ort01 like lfa1-ort01, "city
regio like lfa1-regio, "region
pstlz like lfa1-pstlz, "postal code
land1 like lfa1-land1, "country
telf1 like lfa1-telf1, "first telephone number
telfx like lfa1-telfx, "first fax number
stcd1 like lfa1-stcd1, "fed tax ID#
brsch like lfa1-brsch, "commodity code
akont like lfb1-akont, "reconciliation account
mindk like lfb1-mindk, "monitory indicator
zwels like lfb1-zwels, "payment method
reprf like lfb1-reprf, "check double invoice
banka like bnka-banka, "bank name
stret like bnka-stras, "house number and street
city like bnka-ort01, "city
provz like bnka-provz, "bank state
banks like lfbk-banks, "bank country
swift like bnka-swift, "swift code
bankl like lfbk-bankl, "aba#
bankn like lfbk-bankn, "bank account no
zterm like lfb1-zterm, "payment terms
terms like lfm1-zterm, "terms of payment key
end of t_sheet.
*--- Internal table for Vendor Master data in Text File.
data: begin of t_file occurs 0,
s_session type bgr00,
s_header type blf00,
s_blfa1 type blfa1,
s_blfb1 type blfb1,
s_blfbk type blfbk,
s_blfm1 type blfm1,
s_blfbk type blfbk,
s_blfb5 type blfb5,
s_blfza type blfza,
s_blfm1 type blfm1,
s_blfat type blfat,
s_bwyt1 type bwyt1,
s_bwyt3 type bwyt3,
s_blfm2 type blfm2,
s_blfei type blfei1,
s_blfbw type blfbw,
s_blflr type blflr,
end of t_file.
SELECTION SCREEN *****
*---Selection Parameters.
selection-screen begin of block b1 with frame title title1.
parameters: p_xlfile like rlgrap-filename.
parameters: p_txfile type rlgrap-filename.
selection-screen end of block b1.
INITIALIZATION *****
initialization.
*---Initialize text fields for selection-screen.
title1 = 'Selection Parameters'.
AT SELECTION-SCREEN *****
at selection-screen.
at selection-screen on p_xlfile.
perform check_file using p_xlfile.
at selection-screen on value-request for p_xlfile.
perform select_file using p_xlfile.
START-OF-SELECTION *****
start-of-selection.
clear t_sheet.
refresh t_sheet.
*---Upload Spreadsheet.
perform read_file using p_xlfile.
*---Process data into formatted internal table.
perform format_data.
append t_file.
clear t_file.
endloop.
*---Download data to Text file.
perform download_data.
TOP-OF-PAGE *****
top-of-page.
perform top_of_page.
S-U-B-R-O-U-T-I-N-E-S *****
Form TOP_OF_PAGE
Calling the Standard Report Header
form top_of_page.
perform header using 'CREATE FILE FOR'
'VENDOR MASTER UPLOAD'
132.
skip 2.
endform. "TOP_OF_PAGE
Form check_file **
Checking the File entered **
data: p_filename type string.
form check_file using p_filename.
*---The entered File must be Excel spreadsheet.
data: l_length type i,
l_ext(4) type c.
l_length = strlen( p_xlfile ).
subtract 4 from l_length.
l_ext = p_xlfile+l_length(4).
translate l_ext to upper case.
if l_ext <> '.XLS'.
message e009 with 'Only Excel spreadsheets are supported'.
endif.
*---Check if File exits and not empty.
data: l_return(10) type c.
CALL FUNCTION 'WS_QUERY'
EXPORTING
FILENAME = p_filename
QUERY = 'FL'
IMPORTING
RETURN = l_return
EXCEPTIONS
INV_QUERY = 1
NO_BATCH = 2
FRONTEND_ERROR = 3
OTHERS = 4
IF l_return = space or l_return = '0'.
message e530(pj) with p_filename.
ENDIF.
endform. "CHECK_FILE
Form select_file **
form select_file using p_filename like rlgrap-filename.
CALL FUNCTION 'KD_GET_FILENAME_ON_F4'
EXPORTING
PROGRAM_NAME = SYST-REPID
DYNPRO_NUMBER = SYST-DYNNR
FIELD_NAME = ' '
STATIC = 'X'
MASK = ',MS Excel (.xls),.xls.'
CHANGING
FILE_NAME = p_filename
EXCEPTIONS
MASK_TOO_LONG = 1
OTHERS = 2
IF SY-SUBRC <> 0.
MESSAGE e838(29) with p_filename.
ENDIF.
endform. "SELECT_FILE
Form read_file **
form read_file using p_filename like rlgrap-filename.
*---Display status message for User.
CALL FUNCTION 'SAPGUI_PROGRESS_INDICATOR'
EXPORTING
TEXT = 'Uploading Spreadsheet'
*---Upload spreadsheet.
CALL FUNCTION 'ALSM_EXCEL_TO_INTERNAL_TABLE'
EXPORTING
FILENAME = p_filename
I_BEGIN_COL = 1
I_BEGIN_ROW = 1
I_END_COL = 256
I_END_ROW = 65536
TABLES
INTERN = t_filedata
EXCEPTIONS
INCONSISTENT_PARAMETERS = 1
UPLOAD_OLE = 2
OTHERS = 3
IF t_filedata[] is initial.
message i009 with 'NO DATA FOUND IN FILE' p_filename.
stop.
ENDIF.
sort t_filedata by row col.
endform. "READ_FILE
Form format_data **
form format_data.
data: l_index type i.
field-symbols: <fs1>.
*---Display status message for user.
CALL FUNCTION 'SAPGUI_PROGRESS_INDICATOR'
EXPORTING
TEXT = ' Processing Data...'
loop at t_filedata.
l_index = t_filedata-col.
assign component l_index of structure t_sheet to <fs1>.
<fs1> = t_filedata-value.
at end of row.
append t_sheet.
clear t_sheet.
endat.
endloop.
refresh t_filedata.
free t_filedata.
endform. "FORMAT_DATA
Form download_data.
form download_data.
OPEN DATASET p_txfile for OUTPUT.
LOOP at t_file.
TRANSFER t_file to p_txfile.
ENDLOOP.
CLOSE DATASET p_txfile.
IF SY-SUBRC = 0.
WRITE: / 'Excel to Textfile for Vendor Master Upload: ', P_TXFILE.
ENDIF.
endform. "DOWNLOAD_DATA</b>Hi!
You don't need to program the 'translation' from a file into input data for RFBIKR00 yourself. SAP has done this, so that you can do this (nearly) without programming. If you need some special conversion rules, then you can add some coding, but most is possible without.
Have a look at transaction LSMW. It's not so complicated it looks at the first time. Just look at <a href="http://help.sap.com/saphelp_erp2004/helpdata/en/ad/2d54a41d7011d2b42e006094b944c8/frameset.htm">help</a> for the way to use LSMW.
Regards,
Christian
P.S.: sorry for lost your efforts, but you should switch to LSMW -
I want to know the name of the following tables:
Vendor Master (General level)
Vendor Master table (purchase organization level)
Vendor Master (Company Code Level)
I used LFM1 table but could not find vendor name there. I want details like vendor, purch organisation, company code, reconciliation account, vendor name.
Moderator: Please, search SDNDear:
I have these details regarding master data saved in word file . Please follow given below tables for vendor master data information
Vendor Master (General Section) u2013 LFA1
Vendor Master (Company Code) u2013 LFB1
Vendor master (VAT registration numbers general section) u2013 LFAS
Vendor master (dunning data) u2013 LFB5
Vendor Master (Bank Details) u2013 LFBK
Vendor master record (withholding tax types) X u2013 LFBW
Vendor master record purchasing organization data u2013 LFM1
Vendor Master Record: Purchasing Data u2013 LFM2
Partner Functions - WYT3 -
Table for field settings for vendor master
Dears,
Can you please let me know which table do i need to refer if I want to know which fields are maintained mandatory, optional, suppres for Vendor master for each account groups.
I have looked into table T077K, but the table values are showing for example ..................................... How to conclude with these values.
Please suggest.
Regards
KameshHi
fiedl selection for vendor Mastr depend upon Vendor account gruop there you can fied out which field is optiona or dispaly like wise
check following link
You maintain the account groups in Customizing for Logistics General under Business Partners - Vendor - Control - Define Account Groups and Field Selection (Vendor).
[http://help.sap.com/saphelp_470/helpdata/en/75/ee0b1c55c811d189900000e8322d00/content.htm]
Regards
Kailas Ugale -
Error in the LSMW for vendor master using standard batch/direct input
I am facing the problem in the LSMW for the Vendor master data. The vendor is initially created for the company code 350 by using LSMW. NOw when I try to uploasd the same vendor using the same LSMW for the company code 450 then I get the error in the Bach input creation as follows:
Batch Input Interface for Vendors
FB012 Session 1 : Special character for 'empty field' is /
FB007 Session 1 session name VNDR_CREATE_ was opened
FB104 Trans. 2 XK01 : Acct already exists; general area not being processed
FB125 ... Data in table BLFA1 cannot be processed
FB016 ... Last header record ...
FB014 ... BLF00-STYPE 1
FB014 ... BLF00-TCODE XK01
FB014 ... BLF00-LIFNR 300951
FB014 ... BLF00-BUKRS 402
FB014 ... BLF00-EKORG /
FB014 ... BLF00-KTOKK VEND
FB017 ... Last data record ...
FB014 ... BLFA1-STYPE 2
FB014 ... BLFA1-TBNAM BLFA1
FB014 ... BLFA1-ANRED /
FB014 ... BLFA1-NAME1 SAVOIE AUTOMATISME DEXIS
This is because when we use XK01 to create the vendor by using thePlease check this answered link:
Re: LSMW for Vendor Master
LSMW Upload vendor master data
Edited by: Afshad Irani on May 5, 2010 12:42 PM -
Solved - Group Fields for Vendor Master Records in IMG
This was the solution.
The new field's data element I added to LFB1 did not have the "change document" field checked. I made that change and now that field shows up in IMG.
Hello all,
I added an append structure to the table LFB1. This structure has 1 field. I then created a "Modification-Free Enhancement of Vendor Master Record" to add the new LFB1 field to the vendor master screen, edit and display screens. This is the 3rd time I have done this. So far so good.
Now our functional analyst went into IMG to add this new LFB1 field to a "Group Fields for Vendor Master Records" which we have done 2 other times.
The new LFB1 field does not show up in the list of possible Table-fields.
There must be some other step I am missing.
Does any of this ring a bell? We are on version 4.7.
Thanks
Bruce
p.s.
This is the IMG path for adding 'Field Groups' to vendor master fields.
Financial Accounting/
Accounts Receivable and Accounts Payable/
Vendor Accounts/
Master Data/
Preparations for Creating Vendor Master Data/
Group Fields for Vendor Master Records
Edited by: Bruce Tjosvold on Nov 21, 2008 1:18 PMHi Vandana,
There are several tables that are contain Vendor Master related data which can be used for extraction to BW. Some of the tables which can be useful for you are:
LFA1 : Vendor Master (General Section)
LFM1 : Vendor master record purchasing organization data
LFBW : Vendor master record (withholding tax types) X
WYT3 : Partner Functions
LFBK : Vendor Master (Bank Details)
LFB1: Vendor Master (Company Code)
ADRC: Addresses (Business Address Services)
ADR3: Fax Numbers (Business Address Services)
ADR6: SMTP Numbers (Business Address Services)
ADRT: Communication Data Text (Business Address Services)
You may use the Data sources mentioned in the previous update from Venky above namely :
0VENDOR_ATTR --- for master data attributes
0VENDOR_TEXTS -- For texts
Since the fields that you are using are from different tables so its better if you go for a Generic Data source where you can use the fields as per your requirement.
Thanks
Pawan
Edited by: pawan190187 on Aug 19, 2011 12:40 PM -
Wht r the standard tables for vendor customer and sales order report/
Hi wht r the standard tables for vendor and customer reports and is how in normal we cannot use them for vendor reporting and etc ?
Hi
Customer is related to Sales Module
So for a customer we fetch the reports of Sales orders , Deliveries and Billing doc's
CUstomer and Vendor related tables with important fields:
KNA1: Customer Master-General(KUNNR,NAME1,LAND1)
KNB1: Customer Master(Company Code)(KUNNR,BUKRS,PERNR)
KNC1: Customer Master Data (Transaction Figures)(KUNNR,BUKRS,GJAHR)
KNVK: Customer Master Contact Partner(PARNR,KUNNR,NAME1)
KNVV: Customer Master sales data(KUNNR,VKORG,VTWEG,KDGRP)
KNBK: Customer Bank Details(KUNNR,BANKS,BANKL,BANKN)
KNVH: Customer Hierarchy (HITYP,KUNNR,VKORG,VTWEG,SPART)
KNVP: Customer Master Partner Functions(KUNNR,PARVW,KUNN2)
KNVS: Customer Shipment data(KUNNR,VSTEL,TRANS)
KNVI: Customer Tax data(KUNNR,ALAND,TATYP)
LFA1: Vendor Master-General (LIFNR,NAME1,ORT01)
LFB1: Vendor Master(Company Code)(LIFNR,BUKRS,PERNR)
LFC1: Vendor Master (Transaction Figures)(LIFNR,BUKRS,GJAHR)
Sales related Tables for a customer
VBAK: Sales Document(Header Data) (VBELN, KUNNR)
VBAP: Sales Document(Item Data) (VBELN,POSNR,MATNR,ARKTX,CHARG)
Enquiry, Quotation, Sales Order are differentiated based on Doc.
Type(VBTYP field) in VBAK,VBAP Tables( for Enquiry VBTYP = A,
for Quotation 'B' & for Order it is 'C'.)
LIKP: Delivery Table (Header Data)(VBELN,LFART,KUNNR,WADAT,INCO1)
LIPS: Delivery Table (Item Data)(VBELN,POSNR,WERKS,LGORT,MATNR,VGBEL)
(LIPS-VGBEL = VBAK-VBELN, LIPS-VGPOS = VBAP-POSNR)
VTTK: Shipment Table (Header Data)(TKNUM)
VTTP: Shipment Table (Item Data)( TKNUM,TPNUM,VBELN)
(VTTP-VBELN = LIKP-VBELN)
VTFA: Shipping Document Flow(TKNUM,VBELV,VBELN)
VTPA: Shipping Partners data(VBELN,PARVW,KUNNR,PERNR)
VTTS: Stages in Shipment(TKNUM,TSNUM,TSTYP)
VTSP: Transport Stage/Shipment Item Allocation(TKNUM,TSNUM,TPNUM)
VEKP: Handling Unit: Header(Packing)(VENUM,VSTEL)
VEPO: Handling Unit: Item (Packing)(VENUM,VEPOS,VBELN)
VBRK: Billing Table(Header Data)(VBELN,FKART,BELNR)
VBRP: Billing Table(Item Data)(VBELN,POSNR,FKIMG,NETWR,VGBEL,VGPOS)
(VBRP-AUBEL = VBAK-VBELN, VBRP-VGBEL = LIKP-VBELN)
Apart from these tables there are lot of other tables which starts with
V, but we use the following tables frequently.
VBUK: All Sales Documents status & Admn. Data(Header)(VBELN,VBTYP)
VBTYP= C(Sales Order) VBTYP=J(Delivery) VBTYP=M(Invoice)
VBUP: Sales Documents status & Admn. Data(Item)(VBELN,POSNR)
VBEP: Sales Doc. Schedule Lines Data(VBELN,POSNR,EDATU,WMENG)
VBKD: To get sales related Business data like Payment terms etc.(VBELN,ZTERM)
VBFA: sales document flow data(VBELV,VBELN,POSNV,VBTYP)
VBPA: Partner functions Data(VBELN,PARVW,KUNNR,LIFNR)
VEDA: Contract Data(VBELN,VPOSN)
VEDAPO: Contract Data(VBELN,VPOSN)
Vendor related MM tables
EBAN-- Pur.Reqn. Data (BANFN,BNFPO,BADAT,MATNR)
EBKN-- Purchase Requisition Account Assignment(BANFN,BNFPO,VBELN)
EINA- Purchase Info.Record (General Data)(INFNR,MATNR,LIFNR)
EINE-- Purchase Info.Record (Pur.Orgn Data )(INFNR,EKORG)
ELBK-- Vendor Evaluation Header Data(LIFNR,EKORG,KLASS)
EKKO-- Purchase Order Data (Header)(EBELN,BSTYP,BSART)
EKPO-- Purchase Order Data (Item)(EBELN,EBELP,MATNR)
RFQ and PO are differentiated by Doc Type(BSTYP)in EKKO table.
For RFQ it is A and for PO it is F.
MKPF-- GRN Data (Header) (EBELN,BLDAT,BUDAT,XBLNR,BKTXT)
MSEG-- GRN Data (Item)(MBLNR,BWART,LIFNR,MATNR,EBELN)
Apart from this there are lot of tables which begin with 'M'& 'E', but we
use the following very often.
EKBE--PO History Data (EBELN,EBELP,BELNR,BLDAT,MATNR,VGABE)
EKBZ--PO History with delivery Costs(EBELN,BELNR,LIFNR,XBLNR)
EKET--Schedule lines data of a PO (EBELN,EINDT,SLFDT)
EKES--Vendor Confirmations Data(EBELN,EBTYP,EINDT,XBLNR)
Reward points if useful
Regards
Anji -
Hi, I want to know that standard tables for vendor analasys report and sale
Hi, I want to know that standard reports for vendor analasys report and sale order and customer order report...? why most probably we use tables and fetch the fields rather than standard reports >
Hi
This is the sample report for vendor aging:
Std reports Tcodes are:
customer : s_alr_87012178
vendor : s_alr_87012084
Custom designed:
REPORT zfi_customer_ageing
NO STANDARD PAGE HEADING
LINE-COUNT 58
line-size 168
MESSAGE-ID zh_msg.
D A T A B A S E T A B L E S D E C L A R A T I O N
TABLES: kna1, " Customer Master (General)
t001, " Company Codes
rfpdo.
I N T E R N A L T A B L E S D E C L A R A T I O N S *
Internal Table for Customer Open Items Data
DATA: BEGIN OF int_bsid OCCURS 0,
kunnr LIKE bsid-kunnr, " Customer Number
name1 LIKE kna1-name1, " Customer Name
shkzg LIKE bsid-shkzg, " Dr/Cr Indicator
belnr LIKE bsid-belnr, " Document Number
xblnr LIKE bsid-xblnr, " Ref Doc No
blart LIKE bsid-blart, " Document Type
zfbdt LIKE bsid-zfbdt, " Base Line Date
zbd1t LIKE bsid-zbd1t, " Due date1
zbd2t LIKE bsid-zbd2t, " Due Date2
zbd3t LIKE bsid-zbd3t, " Due Date3
waers LIKE bsid-waers, " Currency
dmbtr LIKE bsid-dmbtr, " Amount in Local Curr
END OF int_bsid.
Internal Table for Amounts Sum Up Data
DATA: BEGIN OF int_final OCCURS 0,
kunnr LIKE bsid-kunnr, " Customer Number
name1 LIKE kna1-name1, " Customer Name
total1 LIKE bsid-dmbtr, " Amount in Local Curr
total2 LIKE bsid-dmbtr, " Amount in Local Curr
total3 LIKE bsid-dmbtr, " Amount in Local Curr
total4 LIKE bsid-dmbtr, " Amount in Local Curr
total5 LIKE bsid-dmbtr, " Amount in Local Curr
total6 LIKE bsid-dmbtr, " Amount in Local Curr
total LIKE bsid-dmbtr, " Amount in Local Curr
END OF int_final.
D A T A D E C L A R A T I O N S
DATA : v_flag, " Flag
v_gtotal1 LIKE bsid-dmbtr, " Amount Totals
v_gtotal2 LIKE bsid-dmbtr, " Amount Totals
v_gtotal3 LIKE bsid-dmbtr, " Amount Totals
v_gtotal4 LIKE bsid-dmbtr, " Amount Totals
v_gtotal5 LIKE bsid-dmbtr, " Amount Totals
v_gtotal6 LIKE bsid-dmbtr, " Amount Totals
v_gtotal LIKE bsid-dmbtr, " Amount Totals
v_subtotal1 LIKE bsid-dmbtr, " Amount Totals
v_subtotal2 LIKE bsid-dmbtr, " Amount Totals
v_subtotal3 LIKE bsid-dmbtr, " Amount Totals
v_subtotal4 LIKE bsid-dmbtr, " Amount Totals
v_subtotal5 LIKE bsid-dmbtr, " Amount Totals
v_subtotal6 LIKE bsid-dmbtr, " Amount Totals
v_subtotal LIKE bsid-dmbtr, " Amount Totals
v_date LIKE bsid-zfbdt, " Due Date
v_tage1(4), " Age 30 days
v_tage2(4), " Age 60 days
v_tage3(4), " Age 90 days
v_fir(15), " Column Text1
v_sec(15), " Column Text2
v_thir(15), " Column Text3
v_four(17), " Column Text4
v_fidd(4), " Days field1
v_sedd(4), " Days field2
v_thdd(4), " Days field3
v_fodd(4), " Days field4
v_str TYPE SY-LISEL, " String
v_str1(11), " String
v_tage(3), " String
v_date1(10). " Date field
R A N G E D E C L A R A T I O N S
RANGES: r_date1 FOR bsid-zfbdt, " Date Range 1
r_date2 FOR bsid-zfbdt, " Date Range 2
r_date3 FOR bsid-zfbdt, " Date Range 3
r_date4 FOR bsid-zfbdt. " Date Range 4
S E L E C T I O N S C R E E N *
SELECTION-SCREEN BEGIN OF BLOCK b1 WITH FRAME TITLE text-001.
SELECT-OPTIONS: s_kunnr FOR kna1-kunnr. "Customer account
PARAMETERS: p_bukrs LIKE t001-bukrs. "Co. Code
SELECTION-SCREEN END OF BLOCK b1.
SELECTION-SCREEN BEGIN OF BLOCK b2 WITH FRAME TITLE text-002.
PARAMETERS: p_allgst LIKE rfpdo-allgstid OBLIGATORY DEFAULT sy-datum.
"Open items at key date
SELECTION-SCREEN END OF BLOCK b2.
SELECTION-SCREEN BEGIN OF BLOCK b3 WITH FRAME TITLE text-003.
PARAMETERS: p_tage1 LIKE rfpdo1-allgfael DEFAULT '30',
p_tage2 LIKE rfpdo1-allgfael DEFAULT '60',
p_tage3 LIKE rfpdo1-allgfael DEFAULT '90',
p_tage4 LIKE rfpdo1-allgfael DEFAULT '120'.
SELECTION-SCREEN END OF BLOCK b3.
A T S E L E C T I O N S C R E E N *
AT SELECTION-SCREEN.
Validate the screen fields
PERFORM validate_flds.
S T A R T O F S E L E C T I O N *
START-OF-SELECTION.
Fetch main data
PERFORM fetch_data.
T O P O F P A G E
Header
TOP-OF-PAGE.
PERFORM header.
E N D O F P A G E
Footer
END-OF-PAGE.
ULINE.
T O P O F P A G E D U R I N G L I N E S E L E C T I O N *
Top of Page in Secondary List
TOP-OF-PAGE DURING LINE-SELECTION.
PERFORM header1.
A T L I N E S E L E C T I O N *
AT LINE-SELECTION.
Perform Line Selections
PERFORM line_selection.
E N D O F S E L E C T I O N
END-OF-SELECTION.
List generation
PERFORM basic_list.
*& Form validate_flds
Validation of Selection Screen fields
FORM validate_flds .
Validate Customer Code
CLEAR kna1-kunnr.
SELECT kunnr UP TO 1 ROWS
INTO kna1-kunnr
FROM kna1
WHERE kunnr IN s_kunnr AND
spras = sy-langu.
ENDSELECT.
IF sy-subrc <> 0.
MESSAGE e000 WITH 'Invalid Customer Code range'(023).
ENDIF.
Validate Company Code
CLEAR t001-bukrs.
SELECT bukrs UP TO 1 ROWS
INTO t001-bukrs
FROM t001
WHERE bukrs = p_bukrs AND
spras = sy-langu.
ENDSELECT.
IF sy-subrc <> 0.
MESSAGE e021. " Invalid Company Code range
ENDIF.
IF ( p_tage1 > p_tage2 ) OR ( p_tage1 > p_tage3 ) OR
( p_tage1 > p_tage4 ).
MESSAGE e999 WITH 'Column 1 greater'(004)
'than Column# 2 or 3 or 4'(005).
ENDIF.
*column 2
IF ( p_tage2 > p_tage3 ) OR ( p_tage1 > p_tage4 ).
MESSAGE e999 WITH 'Column 2 greater'(006)
'than Column# 3 or 4'(007).
ENDIF.
*column3
IF ( p_tage3 > p_tage4 ).
MESSAGE e999 WITH 'Column 3 greater'(008)
'than Column#4'(009).
ENDIF.
ENDFORM. " validate_flds
*& Form fetch_data
Fetching Data from Database Tables
FORM fetch_data .
Date Range Population
r_date1-sign = 'I'.
r_date1-option = 'BT'.
r_date1-low = p_allgst.
r_date1-high = r_date1-low + p_tage1.
APPEND r_date1.
r_date2-sign = 'I'.
r_date2-option = 'BT'.
r_date2-low = r_date1-high + 1.
r_date2-high = r_date1-low + p_tage2.
APPEND r_date2.
r_date3-sign = 'I'.
r_date3-option = 'BT'.
r_date3-low = r_date2-high + 1.
r_date3-high = r_date1-low + p_tage3.
APPEND r_date3.
r_date4-sign = 'I'.
r_date4-option = 'BT'.
r_date4-low = r_date3-high + 1.
r_date4-high = r_date1-low + p_tage4.
APPEND r_date4.
Select the Customer Open Items data from bsid
SELECT l~kunnr
l1~name1
b~waers
b~dmbtr
b~zfbdt
b~zbd1t
b~zbd2t
b~zbd3t
b~belnr
b~xblnr
b~shkzg
b~blart
INTO CORRESPONDING FIELDS OF TABLE int_bsid
FROM knb1 AS l INNER JOIN kna1 AS l1
ON lkunnr = l1kunnr
INNER JOIN bsid AS b
ON lkunnr = bkunnr AND
lbukrs = bbukrs
WHERE l~kunnr IN s_kunnr AND
l~bukrs = p_bukrs and
b~zfbdt le p_allgst.
IF SY-SUBRC <> 0.
MESSAGE i000 WITH 'No Data found'(027).
ENDIF.
Removing the date limit to get the due items in the past
DELETE int_bsid WHERE
( blart NE 'RE' AND blart NE 'KR' ) OR
shkzg NE 'H'.
SORT int_bsid BY kunnr.
ENDFORM. " fetch_data
*& Form header
Display the Report Columns
FORM header .
v_tage1 = p_tage1 + 1.
v_tage2 = p_tage2 + 1.
v_tage3 = p_tage3 + 1.
v_fidd = p_tage1.
v_sedd = p_tage2.
v_thdd = p_tage3.
v_fodd = p_tage4.
MOVE v_fodd0(4) TO v_fodd1(3).
v_fodd+0(1) = space.
CONCATENATE '1 to'(010) v_fidd INTO v_fir.
CONCATENATE v_tage1 ' to '(011) v_sedd INTO v_sec.
CONCATENATE v_tage2 ' to '(011) v_thdd INTO v_thir.
CONCATENATE v_tage3 ' to '(011) space v_fodd INTO v_four.
Standard header
clear: v_date1, v_str, v_str1, v_tage.
write p_allgst to v_date1.
Move p_tage4 to v_tage.
concatenate '>' v_tage text-025 into v_str1.
concatenate
'Summary of Ageing Analysis for Customer Open Invoices as on'(013)
v_date1 into v_str separated by space.
CALL FUNCTION 'Z_STANDARD_HEADER'
EXPORTING
title1 = 'Saudi International Petrochemical Company'(012)
title2 = v_str.
FORMAT COLOR OFF.
WRITE : /1(168) sy-uline.
FORMAT COLOR 1 INTENSIFIED.
WRITE :/1 sy-vline, 13 sy-vline, 49 sy-vline,
50(101) 'Invoices Due For(In Days)'(014) CENTERED,
151 sy-vline, 168 sy-vline .
WRITE :/1 sy-vline, 2(11) 'Customer#'(015) CENTERED,
13 sy-vline ,14(35) 'Customer Name'(016) CENTERED,
49 sy-vline,
50(101) sy-uline,151 sy-vline,
152(16) 'Total'(017) CENTERED,
168 sy-vline.
WRITE : /1 sy-vline,13 sy-vline, 49 sy-vline,
50(16) v_fir CENTERED, 66 sy-vline,
67(16) v_sec CENTERED, 83 sy-vline,
84(16) v_thir CENTERED, 100 sy-vline,
101(16) v_four CENTERED, 117 sy-vline,
118(16) v_str1 centered, 134 sy-vline,
135(16) 'Already Overdue'(018) CENTERED,151 sy-vline,
168 sy-vline.
FORMAT COLOR OFF.
WRITE : /1(168) sy-uline.
ENDFORM. " header
*& Form basic_list
Display the Basic List
FORM basic_list .
NEW-PAGE LINE-SIZE 168.
LOOP AT int_bsid.
CLEAR v_date.
IF int_bsid-zbd3t <> ' '.
v_date = int_bsid-zfbdt + int_bsid-zbd3t.
ELSE.
IF int_bsid-zbd2t <> ' '.
v_date = int_bsid-zfbdt + int_bsid-zbd2t.
ELSE.
v_date = int_bsid-zfbdt + int_bsid-zbd1t.
ENDIF.
ENDIF.
IF int_bsid-zbd1t = ' '.
v_date = int_bsid-zfbdt.
ENDIF.
IF v_date IN r_date1.
int_final-total1 = int_final-total1 + int_bsid-dmbtr.
ELSEIF v_date IN r_date2.
int_final-total2 = int_final-total2 + int_bsid-dmbtr.
ELSEIF v_date IN r_date3.
int_final-total3 = int_final-total3 + int_bsid-dmbtr.
ELSEIF v_date IN r_date4.
int_final-total4 = int_final-total4 + int_bsid-dmbtr.
ELSEif v_date > r_date4-high.
int_final-total5 = int_final-total5 + int_bsid-dmbtr.
ELSEif v_date < p_allgst.
int_final-total6 = int_final-total6 + int_bsid-dmbtr.
ENDIF.
AT END OF kunnr.
v_flag = 1.
ENDAT.
IF v_flag = 1.
int_final-kunnr = int_bsid-kunnr.
int_final-name1 = int_bsid-name1.
int_final-total = int_final-total1 + int_final-total2 +
int_final-total3 + int_final-total4 + int_final-total5 +
int_final-total6.
APPEND int_final.
v_gtotal1 = v_gtotal1 + int_final-total1.
v_gtotal2 = v_gtotal2 + int_final-total2.
v_gtotal3 = v_gtotal3 + int_final-total3.
v_gtotal4 = v_gtotal4 + int_final-total4.
v_gtotal5 = v_gtotal5 + int_final-total5.
v_gtotal6 = v_gtotal6 + int_final-total6.
v_gtotal = v_gtotal + int_final-total.
WRITE: /1 sy-vline,
2 int_final-kunnr COLOR 4 INTENSIFIED ON,
13 sy-vline,
14 int_final-name1 COLOR 4 INTENSIFIED ON,
49 sy-vline.
DATA : v_rem.
v_rem = sy-tabix MOD 2.
IF v_rem NE 0.
FORMAT COLOR 2 INTENSIFIED.
WRITE : 50 int_final-total1 CURRENCY int_bsid-waers,
66 sy-vline,
67 int_final-total2 CURRENCY int_bsid-waers,
83 sy-vline,
84 int_final-total3 CURRENCY int_bsid-waers,
100 sy-vline,
101 int_final-total4 CURRENCY int_bsid-waers,
117 sy-vline,
118 int_final-total5 CURRENCY int_bsid-waers,
134 sy-vline,
135 int_final-total6 CURRENCY int_bsid-waers,
151 sy-vline,
152 int_final-total CURRENCY int_bsid-waers,
168 sy-vline.
ELSE.
WRITE : 50 int_final-total1 CURRENCY int_bsid-waers,
66 sy-vline,
67 int_final-total2 CURRENCY int_bsid-waers,
83 sy-vline,
84 int_final-total3 CURRENCY int_bsid-waers,
100 sy-vline,
101 int_final-total4 CURRENCY int_bsid-waers,
117 sy-vline,
118 int_final-total5 CURRENCY int_bsid-waers,
134 sy-vline,
135 int_final-total6 CURRENCY int_bsid-waers,
151 sy-vline,
152 int_final-total CURRENCY int_bsid-waers,
168 sy-vline.
ENDIF.
FORMAT COLOR OFF.
HIDE int_final.
CLEAR int_final.
v_flag = 0.
ENDIF.
AT LAST.
WRITE : /1(168) sy-uline.
FORMAT COLOR 3 INTENSIFIED.
WRITE : /1 sy-vline, 2(47) 'GRAND TOTAL'(022) CENTERED,
49 sy-vline, 50 v_gtotal1 CURRENCY int_bsid-waers,
66 sy-vline, 67 v_gtotal2 CURRENCY int_bsid-waers,
83 sy-vline, 84 v_gtotal3 CURRENCY int_bsid-waers,
100 sy-vline,101 v_gtotal4 CURRENCY int_bsid-waers,
117 sy-vline,118 v_gtotal5 CURRENCY int_bsid-waers,
134 sy-vline,135 v_gtotal6 CURRENCY int_bsid-waers,
151 sy-vline,152 v_gtotal CURRENCY int_bsid-waers,
168 sy-vline.
HIDE : v_gtotal1,
v_gtotal2,
v_gtotal3,
v_gtotal4,
v_gtotal5,
v_gtotal6,
v_gtotal.
ENDAT.
FORMAT COLOR OFF.
ENDLOOP.
WRITE : /1(168) sy-uline.
ENDFORM. " basic_list
*& Form line_selection
When double clicked on the line display the seconday list
FORM line_selection .
NEW-PAGE LINE-SIZE 206.
Sy-lsind = 1.
DATA : v_rem,v_cnt LIKE sy-tabix.
v_cnt = 0.
SORT int_bsid BY belnr zfbdt.
LOOP AT int_bsid WHERE kunnr EQ int_final-kunnr.
v_rem = v_cnt MOD 2.
CLEAR v_date.
IF int_bsid-zbd3t <> ' '.
v_date = int_bsid-zfbdt + int_bsid-zbd3t.
ELSE.
IF int_bsid-zbd2t <> ' '.
v_date = int_bsid-zfbdt + int_bsid-zbd2t.
ELSE.
v_date = int_bsid-zfbdt + int_bsid-zbd1t.
ENDIF.
ENDIF.
IF int_bsid-zbd1t = ' '.
v_date = int_bsid-zfbdt.
ENDIF.
IF v_rem NE 0.
format color 2 intensified.
WRITE :/1 sy-vline, 2 int_bsid-belnr,
12 sy-vline,13 int_bsid-kunnr,
23 sy-vline,24 int_bsid-name1,
59 sy-vline,60 int_bsid-xblnr,
76 sy-vline,77 int_bsid-zfbdt,
87 sy-vline.
WRITE : 104 sy-vline,121 sy-vline,
138 sy-vline,155 sy-vline,
172 sy-vline, 189 sy-vline,
190 int_bsid-dmbtr CURRENCY int_bsid-waers,
206 sy-vline.
IF v_date IN r_date1.
v_subtotal1 = v_subtotal1 + int_bsid-dmbtr.
WRITE : 88 int_bsid-dmbtr CURRENCY int_bsid-waers.
ELSEIF v_date IN r_date2.
v_subtotal2 = v_subtotal2 + int_bsid-dmbtr.
WRITE : 105 int_bsid-dmbtr CURRENCY int_bsid-waers.
ELSEIF v_date IN r_date3.
v_subtotal3 = v_subtotal3 + int_bsid-dmbtr.
WRITE : 122 int_bsid-dmbtr CURRENCY int_bsid-waers.
ELSEIF v_date IN r_date4.
v_subtotal4 = v_subtotal4 + int_bsid-dmbtr.
WRITE : 139 int_bsid-dmbtr CURRENCY int_bsid-waers.
ELSEif v_date > r_date4-high.
v_subtotal5 = v_subtotal5 + int_bsid-dmbtr.
WRITE : 156 int_bsid-dmbtr CURRENCY int_bsid-waers.
ELSEif v_date < p_allgst.
v_subtotal6 = v_subtotal6 + int_bsid-dmbtr.
WRITE : 173 int_bsid-dmbtr CURRENCY int_bsid-waers.
ENDIF.
format color off.
ELSE.
WRITE :/1 sy-vline, 2 int_bsid-belnr,
12 sy-vline,13 int_bsid-kunnr,
23 sy-vline,24 int_bsid-name1,
59 sy-vline,60 int_bsid-xblnr,
76 sy-vline,77 int_bsid-zfbdt,
87 sy-vline.
WRITE : 104 sy-vline,121 sy-vline,
138 sy-vline,155 sy-vline,
172 sy-vline,189 sy-vline,
190 int_bsid-dmbtr CURRENCY int_bsid-waers,
206 sy-vline.
IF v_date IN r_date1.
v_subtotal1 = v_subtotal1 + int_bsid-dmbtr.
WRITE : 88 int_bsid-dmbtr CURRENCY int_bsid-waers.
ELSEIF v_date IN r_date2.
v_subtotal2 = v_subtotal2 + int_bsid-dmbtr.
WRITE : 105 int_bsid-dmbtr CURRENCY int_bsid-waers.
ELSEIF v_date IN r_date3.
v_subtotal3 = v_subtotal3 + int_bsid-dmbtr.
WRITE : 122 int_bsid-dmbtr CURRENCY int_bsid-waers.
ELSEIF v_date IN r_date4.
v_subtotal4 = v_subtotal4 + int_bsid-dmbtr.
WRITE : 139 int_bsid-dmbtr CURRENCY int_bsid-waers.
ELSEif v_date > r_date4-high.
v_subtotal5 = v_subtotal5 + int_bsid-dmbtr.
WRITE : 156 int_bsid-dmbtr CURRENCY int_bsid-waers.
ELSEif v_date < p_allgst.
v_subtotal6 = v_subtotal6 + int_bsid-dmbtr.
WRITE : 173 int_bsid-dmbtr CURRENCY int_bsid-waers.
ENDIF.
ENDIF.
FORMAT COLOR OFF.
v_cnt = v_cnt + 1.
ENDLOOP.
WRITE : /1(206) sy-uline.
v_subtotal = v_subtotal1 + v_subtotal2 + v_subtotal3
+ v_subtotal4 + v_subtotal5 + v_subtotal6.
FORMAT COLOR 3 INTENSIFIED.
WRITE : /1 sy-vline,
2(85) 'Total'(017) CENTERED CURRENCY int_bsid-waers ,
87 sy-vline,
88 v_subtotal1 CURRENCY int_bsid-waers,
104 sy-vline,
105 v_subtotal2 CURRENCY int_bsid-waers,
121 sy-vline,
122 v_subtotal3 CURRENCY int_bsid-waers,
138 sy-vline,
139 v_subtotal4 CURRENCY int_bsid-waers,
155 sy-vline,
156 v_subtotal5 CURRENCY int_bsid-waers,
172 sy-vline,
173 v_subtotal6 CURRENCY int_bsid-waers,
189 sy-vline,
190 v_subtotal CURRENCY int_bsid-waers,
206 sy-vline.
FORMAT COLOR OFF.
WRITE : /1(206) sy-uline.
CLEAR : v_subtotal,v_subtotal1,v_subtotal2,v_subtotal3,
v_subtotal4,v_subtotal5,v_gtotal1,v_gtotal2,v_gtotal3,
v_gtotal4, v_gtotal5,v_gtotal,v_subtotal6,v_gtotal6.
ENDFORM. " line_selection
*& Form header1
Secondary List Header
FORM header1 .
Standard header
clear: v_date1, v_str, v_str1, v_tage.
write p_allgst to v_date1.
Move p_tage4 to v_tage.
concatenate '>' v_tage text-025 into v_str1.
concatenate
'Details of Ageing Analysis for Customer Open Invoices as on'(024)
v_date1 into v_str separated by space.
CALL FUNCTION 'Z_STANDARD_HEADER'
EXPORTING
title1 = 'Saudi International Petrochemical Company'(012)
title2 = v_str.
FORMAT COLOR 1 intensified.
WRITE :/1(206) sy-uline.
WRITE :/1 sy-vline,12 sy-vline ,
23 sy-vline,59 sy-vline,76 sy-vline,87 sy-vline,
88(101) 'Invoices Due For(In Days)'(014) CENTERED,
189 sy-vline,206 sy-vline.
WRITE : /1 sy-vline, 2(10) 'Doc Number'(021) CENTERED,
12 sy-vline, 13(10) 'Customer#'(015) CENTERED,
23 sy-vline, 24(35) 'Customer Name'(016) CENTERED,
59 sy-vline, 60(16) 'Ref invoice#'(019) CENTERED,
76 sy-vline, 77(10) 'Inv dt'(020) CENTERED,
87 sy-vline, 88(101) sy-uline,
189 sy-vline,190(16) 'Total'(017) CENTERED,
206 sy-vline.
WRITE : /1 sy-vline, 12 sy-vline,
23 sy-vline,59 sy-vline,
76 sy-vline,87 sy-vline,
88(16) v_fir CENTERED, 104 sy-vline,
105(16) v_sec CENTERED, 121 sy-vline,
122(16) v_thir CENTERED, 138 sy-vline,
139(16) v_four CENTERED, 155 sy-vline,
156(16) v_str1 CENTERED,
172 sy-vline,
173(16) 'Already Overdue'(018) CENTERED,
189 sy-vline,
206 sy-vline.
format color off.
WRITE : /1(206) sy-uline.
ENDFORM. " header1
REPORT zfi_vendor_ageing
NO STANDARD PAGE HEADING
LINE-COUNT 58
line-size 168
MESSAGE-ID zh_msg.
Report Name : Vendor Open Items Ageing Report
Purpose : This report displays the Vendor Open Items based on
different Ageing days (Calculated by taking the Base
Line date and the days mentioned in Payment Terms)
M O D I F I C A T I O N L O G
Date | Change Number | Initials | Description
30-Aug-2004 | DTSK900**** | Anji Reddy | Initial
D A T A B A S E T A B L E S D E C L A R A T I O N
TABLES: lfa1, " Vendor Master (General)
t001, " Company Codes
rfpdo.
I N T E R N A L T A B L E S D E C L A R A T I O N S *
Internal Table for Vendor Open Items Data
DATA: BEGIN OF int_bsik OCCURS 0,
lifnr LIKE bsik-lifnr, " Vendor Number
name1 LIKE lfa1-name1, " Vendor Name
shkzg LIKE bsik-shkzg, " Dr/Cr Indicator
belnr LIKE bsik-belnr, " Document Number
xblnr LIKE bsik-xblnr, " Ref Doc No
blart LIKE bsik-blart, " Document Type
zfbdt LIKE bsik-zfbdt, " Base Line Date
zbd1t LIKE bsik-zbd1t, " Due date1
zbd2t LIKE bsik-zbd2t, " Due Date2
zbd3t LIKE bsik-zbd3t, " Due Date3
waers LIKE bsik-waers, " Currency
dmbtr LIKE bsik-dmbtr, " Amount in Local Curr
END OF int_bsik.
Internal Table for Amounts Sum Up Data
DATA: BEGIN OF int_final OCCURS 0,
lifnr LIKE bsik-lifnr, " Vendor Number
name1 LIKE lfa1-name1, " Vendor Name
total1 LIKE bsik-dmbtr, " Amount in Local Curr
total2 LIKE bsik-dmbtr, " Amount in Local Curr
total3 LIKE bsik-dmbtr, " Amount in Local Curr
total4 LIKE bsik-dmbtr, " Amount in Local Curr
total5 LIKE bsik-dmbtr, " Amount in Local Curr
total6 LIKE bsik-dmbtr, " Amount in Local Curr
total LIKE bsik-dmbtr, " Amount in Local Curr
END OF int_final.
D A T A D E C L A R A T I O N S
DATA : v_flag, " Flag
v_gtotal1 LIKE bsik-dmbtr, " Amount Totals
v_gtotal2 LIKE bsik-dmbtr, " Amount Totals
v_gtotal3 LIKE bsik-dmbtr, " Amount Totals
v_gtotal4 LIKE bsik-dmbtr, " Amount Totals
v_gtotal5 LIKE bsik-dmbtr, " Amount Totals
v_gtotal6 LIKE bsik-dmbtr, " Amount Totals
v_gtotal LIKE bsik-dmbtr, " Amount Totals
v_subtotal1 LIKE bsik-dmbtr, " Amount Totals
v_subtotal2 LIKE bsik-dmbtr, " Amount Totals
v_subtotal3 LIKE bsik-dmbtr, " Amount Totals
v_subtotal4 LIKE bsik-dmbtr, " Amount Totals
v_subtotal5 LIKE bsik-dmbtr, " Amount Totals
v_subtotal6 LIKE bsik-dmbtr, " Amount Totals
v_subtotal LIKE bsik-dmbtr, " Amount Totals
v_date LIKE bsik-zfbdt, " Due Date
v_tage1(4), " Age 30 days
v_tage2(4), " Age 60 days
v_tage3(4), " Age 90 days
v_fir(15), " Column Text1
v_sec(15), " Column Text2
v_thir(15), " Column Text3
v_four(17), " Column Text4
v_fidd(4), " Days field1
v_sedd(4), " Days field2
v_thdd(4), " Days field3
v_fodd(4), " Days field4
v_str TYPE SY-LISEL, " String
v_str1(11), " String
v_tage(3), " String
v_date1(10). " Date field
R A N G E D E C L A R A T I O N S
RANGES: r_date1 FOR bsik-zfbdt, " Date Range 1
r_date2 FOR bsik-zfbdt, " Date Range 2
r_date3 FOR bsik-zfbdt, " Date Range 3
r_date4 FOR bsik-zfbdt. " Date Range 4
S E L E C T I O N S C R E E N *
SELECTION-SCREEN BEGIN OF BLOCK b1 WITH FRAME TITLE text-001.
SELECT-OPTIONS: s_lifnr FOR lfa1-lifnr. "Vendor account
PARAMETERS: p_bukrs LIKE t001-bukrs. "Co. Code
SELECTION-SCREEN END OF BLOCK b1.
SELECTION-SCREEN BEGIN OF BLOCK b2 WITH FRAME TITLE text-002.
PARAMETERS: p_allgst LIKE rfpdo-allgstid OBLIGATORY DEFAULT sy-datum.
"Open items at key date
SELECTION-SCREEN END OF BLOCK b2.
SELECTION-SCREEN BEGIN OF BLOCK b3 WITH FRAME TITLE text-003.
PARAMETERS: p_tage1 LIKE rfpdo1-allgfael DEFAULT '30',
p_tage2 LIKE rfpdo1-allgfael DEFAULT '60',
p_tage3 LIKE rfpdo1-allgfael DEFAULT '90',
p_tage4 LIKE rfpdo1-allgfael DEFAULT '120'.
SELECTION-SCREEN END OF BLOCK b3.
A T S E L E C T I O N S C R E E N *
AT SELECTION-SCREEN.
Validate the screen fields
PERFORM validate_flds.
S T A R T O F S E L E C T I O N *
START-OF-SELECTION.
Fetch main data
PERFORM fetch_data.
T O P O F P A G E
Header
TOP-OF-PAGE.
PERFORM header.
E N D O F P A G E
Footer
END-OF-PAGE.
ULINE.
T O P O F P A G E D U R I N G L I N E S E L E C T I O N *
Top of Page in Secondary List
TOP-OF-PAGE DURING LINE-SELECTION.
PERFORM header1.
A T L I N E S E L E C T I O N *
AT LINE-SELECTION.
Perform Line Selections
PERFORM line_selection.
E N D O F S E L E C T I O N
END-OF-SELECTION.
List generation
PERFORM basic_list.
*& Form validate_flds
Validation of Selection Screen fields
FORM validate_flds .
Validate Vendor Code
CLEAR lfa1-lifnr.
SELECT lifnr UP TO 1 ROWS
INTO lfa1-lifnr
FROM lfa1
WHERE lifnr IN s_lifnr AND
spras = sy-langu.
ENDSELECT.
IF sy-subrc <> 0.
MESSAGE e000 WITH 'Invalid Vendor Code range'(023).
ENDIF.
Validate Company Code
CLEAR t001-bukrs.
SELECT bukrs UP TO 1 ROWS
INTO t001-bukrs
FROM t001
WHERE bukrs = p_bukrs AND
spras = sy-langu.
ENDSELECT.
IF sy-subrc <> 0.
MESSAGE e021. " Invalid Company Code range
ENDIF.
IF ( p_tage1 > p_tage2 ) OR ( p_tage1 > p_tage3 ) OR
( p_tage1 > p_tage4 ).
MESSAGE e999 WITH 'Column 1 greater'(004)
'than Column# 2 or 3 or 4'(005).
ENDIF.
*column 2
IF ( p_tage2 > p_tage3 ) OR ( p_tage1 > p_tage4 ).
MESSAGE e999 WITH 'Column 2 greater'(006)
'than Column# 3 or 4'(007).
ENDIF.
*column3
IF ( p_tage3 > p_tage4 ).
MESSAGE e999 WITH 'Column 3 greater'(008)
'than Column#4'(009).
ENDIF.
ENDFORM. " validate_flds
*& Form fetch_data
Fetching Data from Database Tables
FORM fetch_data .
Date Range Population
r_date1-sign = 'I'.
r_date1-option = 'BT'.
r_date1-low = p_allgst.
r_date1-high = r_date1-low + p_tage1.
APPEND r_date1.
r_date2-sign = 'I'.
r_date2-option = 'BT'.
r_date2-low = r_date1-high + 1.
r_date2-high = r_date1-low + p_tage2.
APPEND r_date2.
r_date3-sign = 'I'.
r_date3-option = 'BT'.
r_date3-low = r_date2-high + 1.
r_date3-high = r_date1-low + p_tage3.
APPEND r_date3.
r_date4-sign = 'I'.
r_date4-option = 'BT'.
r_date4-low = r_date3-high + 1.
r_date4-high = r_date1-low + p_tage4.
APPEND r_date4.
Select the Vendor Open Items data from BSIK
SELECT l~lifnr
l1~name1
b~waers
b~dmbtr
b~zfbdt
b~zbd1t
b~zbd2t
b~zbd3t
b~belnr
b~xblnr
b~shkzg
b~blart
INTO CORRESPONDING FIELDS OF TABLE int_bsik
FROM lfb1 AS l INNER JOIN lfa1 AS l1
ON llifnr = l1lifnr
INNER JOIN bsik AS b
ON llifnr = blifnr AND
lbukrs = bbukrs
WHERE l~lifnr IN s_lifnr AND
l~bukrs = p_bukrs and
b~zfbdt le p_allgst.
IF SY-SUBRC <> 0.
MESSAGE i000 WITH 'No Data found'(027).
ENDIF.
Removing the date limit to get the due items in the past
DELETE int_bsik WHERE
( blart NE 'RE' AND blart NE 'KR' ) OR
shkzg NE 'H'.
SORT int_bsik BY lifnr.
ENDFORM. " fetch_data
*& Form header
Display the Report Columns
FORM header .
v_tage1 = p_tage1 + 1.
v_tage2 = p_tage2 + 1.
v_tage3 = p_tage3 + 1.
v_fidd = p_tage1.
v_sedd = p_tage2.
v_thdd = p_tage3.
v_fodd = p_tage4.
MOVE v_fodd0(4) TO v_fodd1(3).
v_fodd+0(1) = space.
CONCATENATE '1 to'(010) v_fidd INTO v_fir.
CONCATENATE v_tage1 ' to '(011) v_sedd INTO v_sec.
CONCATENATE v_tage2 ' to '(011) v_thdd INTO v_thir.
CONCATENATE v_tage3 ' to '(011) space v_fodd INTO v_four.
Standard header
clear: v_date1, v_str, v_str1, v_tage.
write p_allgst to v_date1.
Move p_tage4 to v_tage.
concatenate '>' v_tage text-025 into v_str1.
concatenate
'Summary of Ageing Analysis for Vendor Open Invoices as on'(013)
v_date1 into v_str separated by space.
CALL FUNCTION 'Z_STANDARD_HEADER'
EXPORTING
title1 = 'Saudi International Petrochemical Company'(012)
title2 = v_str.
FORMAT COLOR OFF.
WRITE : /1(168) sy-uline.
FORMAT COLOR 1 INTENSIFIED.
WRITE :/1 sy-vline, 13 sy-vline, 49 sy-vline,
50(101) 'Invoices Due For(In Days)'(014) CENTERED,
151 sy-vline, 168 sy-vline .
WRITE :/1 sy-vline, 2(11) 'Vendor#'(015) CENTERED,
13 sy-vline ,14(35) 'Vendor Name'(016) CENTERED,
49 sy-vline,
50(101) sy-uline,151 sy-vline,
152(16) 'Total'(017) CENTERED,
168 sy-vline.
WRITE : /1 sy-vline,13 sy-vline, 49 sy-vline,
50(16) v_fir CENTERED, 66 sy-vline,
67(16) v_sec CENTERED, 83 sy-vline,
84(16) v_thir CENTERED, 100 sy-vline,
101(16) v_four CENTERED, 117 sy-vline,
118(16) v_str1 centered, 134 sy-vline,
135(16) 'Already Overdue'(018) CENTERED,151 sy-vline,
168 sy-vline.
FORMAT COLOR OFF.
WRITE : /1(168) sy-uline.
ENDFORM. " header
*& Form basic_list
Display the Basic List
FORM basic_list .
NEW-PAGE LINE-SIZE 168.
LOOP AT int_bsik.
CLEAR v_date.
IF int_bsik-zbd3t <> ' '.
v_date = int_bsik-zfbdt + int_bsik-zbd3t.
ELSE.
IF int_bsik-zbd2t <> ' '.
v_date = int_bsik-zfbdt + int_bsik-zbd2t.
ELSE.
v_date = int_bsik-zfbdt + int_bsik-zbd1t.
ENDIF.
ENDIF.
IF int_bsik-zbd1t = ' '.
v_date = int_bsik-zfbdt.
ENDIF.
IF v_date IN r_date1.
int_final-total1 = int_final-total1 + int_bsik-dmbtr.
ELSEIF v_date IN r_date2.
int_final-total2 = int_final-total2 + int_bsik-dmbtr.
ELSEIF v_date IN r_date3.
int_final-total3 = int_final-total3 + int_bsik-dmbtr.
ELSEIF v_date IN r_date4.
int_final-total4 = int_final-total4 + int_bsik-dmbtr.
ELSEif v_date > r_date4-high.
int_final-total5 = int_final-total5 + int_bsik-dmbtr.
ELSEif v_date < p_allgst.
int_final-total6 = int_final-total6 + int_bsik-dmbtr.
ENDIF.
AT END OF lifnr.
v_flag = 1.
ENDAT.
IF v_flag = 1.
int_final-lifnr = int_bsik-lifnr.
int_final-name1 = int_bsik-name1.
int_final-total = int_final-total1 + int_final-total2 +
int_final-total3 + int_final-total4 + int_final-total5 +
int_final-total6.
APPEND int_final.
v_gtotal1 = v_gtotal1 + int_final-total1.
v_gtotal2 = v_gtotal2 + int_final-total2.
v_gtotal3 = v_gtotal3 + int_final-total3.
v_gtotal4 = v_gtotal4 + int_final-total4.
v_gtotal5 = v_gtotal5 + int_final-total5.
v_gtotal6 = v_gtotal6 + int_final-total6.
v_gtotal = v_gtotal + int_final-total.
WRITE: /1 sy-vline,
2 int_final-lifnr COLOR 4 INTENSIFIED ON,
13 sy-vline,
14 int_final-name1 COLOR 4 INTENSIFIED ON,
49 sy-vline.
DATA : v_rem.
v_rem = sy-tabix MOD 2.
IF v_rem NE 0.
FORMAT COLOR 2 INTENSIFIED.
WRITE : 50 int_final-total1 CURRENCY int_bsik-waers,
66 sy-vline,
67 int_final-total2 CURRENCY int_bsik-waers,
83 sy-vline,
84 int_final-total3 CURRENCY int_bsik-waers,
100 sy-vline,
101 int_final-total4 CURRENCY int_bsik-waers,
117 sy-vline,
118 int_final-total5 CURRENCY int_bsik-waers,
134 sy-vline,
135 int_final-total6 CURRENCY int_bsik-waers,
151 sy-vline,
152 int_final-total CURRENCY int_bsik-waers,
168 sy-vline.
ELSE.
WRITE : 50 int_final-total1 CURRENCY int_bsik-waers,
66 sy-vline,
67 int_final-total2 CURRENCY int_bsik-waers,
83 sy-vline,
84 int_final-total3 CURRENCY int_bsik-waers,
100 sy-vline,
101 int_final-total4 CURRENCY int_bsik-waers,
117 sy-vline,
118 int_final-total5 CURRENCY int_bsik-waers,
134 sy-vline,
135 int_final-total6 CURRENCY int_bsik-waers,
151 sy-vline,
152 int_final-total CURRENCY int_bsik-waers,
168 sy-vline.
ENDIF.
FORMAT COLOR OFF.
HIDE int_final.
CLEAR int_final.
v_flag = 0.
ENDIF.
AT LAST.
WRITE : /1(168) sy-uline.
FORMAT COLOR 3 INTENSIFIED.
WRITE : /1 sy-vline, 2(47) 'GRAND TOTAL'(022) CENTERED,
49 sy-vline, 50 v_gtotal1 CURRENCY int_bsik-waers,
66 sy-vline, 67 v_gtotal2 CURRENCY int_bsik-waers,
83 sy-vline, 84 v_gtotal3 CURRENCY int_bsik-waers,
100 sy-vline,101 v_gtotal4 CURRENCY int_bsik-waers,
117 sy-vline,118 v_gtotal5 CURRENCY int_bsik-waers,
134 sy-vline,135 v_gtotal6 CURRENCY int_bsik-waers,
151 sy-vline,152 v_gtotal CURRENCY int_bsik-waers,
168 sy-vline.
HIDE : v_gtotal1,
v_gtotal2,
v_gtotal3,
v_gtotal4,
v_gtotal5,
v_gtotal6,
v_gtotal.
ENDAT.
FORMAT COLOR OFF.
ENDLOOP.
WRITE : /1(168) sy-uline.
ENDFORM. " basic_list
*& Form line_selection
When double clicked on the line display the seconday list
FORM line_selection .
NEW-PAGE LINE-SIZE 206.
Sy-lsind = 1.
DATA : v_rem,v_cnt LIKE sy-tabix.
v_cnt = 0.
SORT int_bsik BY belnr zfbdt.
LOOP AT int_bsik WHERE lifnr EQ int_final-lifnr.
v_rem = v_cnt MOD 2.
CLEAR v_date.
IF int_bsik-zbd3t <> ' '.
v_date = int_bsik-zfbdt + int_bsik-zbd3t.
ELSE.
IF int_bsik-zbd2t <> ' '.
v_date = int_bsik-zfbdt + int_bsik-zbd2t.
ELSE.
v_date = int_bsik-zfbdt + int_bsik-zbd1t.
ENDIF.
ENDIF.
IF int_bsik-zbd1t = ' '.
v_date = int_bsik-zfbdt.
ENDIF.
IF v_rem NE 0.
format color 2 intensified.
WRITE :/1 sy-vline, 2 int_bsik-belnr,
12 sy-vline,13 int_bsik-lifnr,
23 sy-vline,24 int_bsik-name1,
59 sy-vline,60 int_bsik-xblnr,
76 sy-vline,77 int_bsik-zfbdt,
87 sy-vline.
WRITE : 104 sy-vline,121 sy-vline,
138 sy-vline,155 sy-vline,
172 sy-vline, 189 sy-vline,
190 int_bsik-dmbtr CURRENCY int_bsik-waers,
206 sy-vline.
IF v_date IN r_date1.
v_subtotal1 = v_subtotal1 + int_bsik-dmbtr.
WRITE : 88 int_bsik-dmbtr CURRENCY int_bsik-waers.
ELSEIF v_date IN r_date2.
v_subtotal2 = v_subtotal2 + int_bsik-dmbtr.
WRITE : 105 int_bsik-dmbtr CURRENCY int_bsik-waers.
ELSEIF v_date IN r_date3.
v_subtotal3 = v_subtotal3 + int_bsik-dmbtr.
WRITE : 122 int_bsik-dmbtr CURRENCY int_bsik-waers.
ELSEIF v_date IN r_date4.
v_subtotal4 = v_subtotal4 + int_bsik-dmbtr.
WRITE : 139 int_bsik-dmbtr CURRENCY int_bsik-waers.
ELSEif v_date > r_date4-high.
v_subtotal5 = v_subtotal5 + int_bsik-dmbtr.
WRITE : 156 int_bsik-dmbtr CURRENCY int_bsik-waers.
ELSEif v_date < p_allgst.
v_subtotal6 = v_subtotal6 + int_bsik-dmbtr.
WRITE : 173 int_bsik-dmbtr CURRENCY int_bsik-waers.
ENDIF.
format color off.
ELSE.
WRITE :/1 sy-vline, 2 int_bsik-belnr,
12 sy-vline,13 int_bsik-lifnr,
23 sy-vline,24 int_bsik-name1,
59 sy-vline,60 int_bsik-xblnr,
76 sy-vline,77 int_bsik-zfbdt,
87 sy-vline.
WRITE : 104 sy-vline,121 sy-vline,
138 sy-vline,155 sy-vline,
172 sy-vline,189 sy-vline,
190 int_bsik-dmbtr CURRENCY int_bsik-waers,
206 sy-vline.
IF v_date IN r_date1.
v_subtotal1 = v_subtotal1 + int_bsik-dmbtr.
WRITE : 88 int_bsik-dmbtr CURRENCY int_bsik-waers.
ELSEIF v_date IN r_date2.
v_subtotal2 = v_subtotal2 + int_bsik-dmbtr.
WRITE : 105 int_bsik-dmbtr CURRENCY int_bsik-waers.
ELSEIF v_date IN r_date3.
v_subtotal3 = v_subtotal3 + int_bsik-dmbtr.
WRITE : 122 int_bsik-dmbtr CURRENCY int_bsik-waers.
ELSEIF v_date IN r_date4.
v_subtotal4 = v_subtotal4 + int_bsik-dmbtr.
WRITE : 139 int_bsik-dmbtr CURRENCY int_bsik-waers.
ELSEif v_date > r_date4-high.
v_subtotal5 = v_subtotal5 + int_bsik-dmbtr.
WRITE : 156 int_bsik-dmbtr CURRENCY int_bsik-waers.
ELSEif v_date < p_allgst.
v_subtotal6 = v_subtotal6 + int_bsik-dmbtr.
WRITE : 173 int_bsik-dmbtr CURRENCY int_bsik-waers.
ENDIF.
ENDIF.
FORMAT COLOR OFF.
v_cnt = v_cnt + 1.
ENDLOOP.
WRITE : /1(206) sy-uline.
v_subtotal = v_subtotal1 + v_subtotal2 + v_subtotal3
+ v_subtotal4 + v_subtotal5 + v_subtotal6.
FORMAT COLOR 3 INTENSIFIED.
WRITE : /1 sy-vline,
2(85) 'Total'(017) CENTERED CURRENCY int_bsik-waers ,
87 sy-vline,
88 v_subtotal1 CURRENCY int_bsik-waers,
104 sy-vline,
105 v_subtotal2 CURRENCY int_bsik-waers,
121 sy-vline,
122 v_subtotal3 CURRENCY int_bsik-waers,
138 sy-vline,
139 v_subtotal4 CURRENCY int_bsik-waers,
155 sy-vline,
156 v_subtotal5 CURRENCY int_bsik-waers,
172 sy-vline,
173 v_subtotal6 CURRENCY int_bsik-waers,
189 sy-vline,
190 v_subtotal CURRENCY int_bsik-waers,
206 sy-vline.
FORMAT COLOR OFF.
WRITE : /1(206) sy-uline.
CLEAR : v_subtotal,v_subtotal1,v_subtotal2,v_subtotal3,
v_subtotal4,v_subtotal5,v_gtotal1,v_gtotal2,v_gtotal3,
v_gtotal4, v_gtotal5,v_gtotal,v_subtotal6,v_gtotal6.
ENDFORM. " line_selection
*& Form header1
Secondary List Header
FORM header1 .
Standard header
clear: v_date1, v_str, v_str1, v_tage.
write p_allgst to v_date1.
Move p_tage4 to v_tage.
concatenate '>' v_tage text-025 into v_str1.
concatenate
'Details of Ageing Analysis for Vendor Open Invoices as on'(024)
v_date1 into v_str separated by space.
CALL FUNCTION 'Z_STANDARD_HEADER'
EXPORTING
title1 = 'Saudi International Petrochemical Company'(012)
title2 = v_str.
FORMAT COLOR 1 intensified.
WRITE :/1(206) sy-uline.
WRITE :/1 sy-vline,12 sy-vline ,
23 sy-vline,59 sy-vline,76 sy-vline,87 sy-vline,
88(101) 'Invoices Due For(In Days)'(014) CENTERED,
189 sy-vline,206 sy-vline.
WRITE : /1 sy-vline, 2(10) 'Doc Number'(021) CENTERED,
12 sy-vline, 13(10) 'Vendor#'(015) CENTERED,
23 sy-vline, 24(35) 'Vendor Name'(016) CENTERED,
59 sy-vline, 60(16) 'Ref invoice#'(019) CENTERED,
76 sy-vline, 77(10) 'Inv dt'(020) CENTERED,
87 sy-vline, 88(101) sy-uline,
189 sy-vline,190(16) 'Total'(017) CENTERED,
206 sy-vline.
WRITE : /1 sy-vline, 12 sy-vline,
23 sy-vline,59 sy-vline,
76 sy-vline,87 sy-vline,
88(16) v_fir CENTERED, 104 sy-vline,
105(16) v_sec CENTERED, 121 sy-vline,
122(16) v_thir CENTERED, 138 sy-vline,
139(16) v_four CENTERED, 155 sy-vline,
156(16) v_str1 CENTERED,
172 sy-vline,
173(16) 'Already Overdue'(018) CENTERED,
189 sy-vline,
206 sy-vline.
format color off.
WRITE : /1(206) sy-uline.
ENDFORM. " header1
<b>The below link will give Tables & Relations.</b>
http://www.erpgenie.com/abap/tables.htm
http://goldenink.com/abap/files_in_sap.html
http://abap4.tripod.com/SAP_Tables.html
http://www.geocities.com/sapcircle/Relations.pdf
Regards,
Sree -
Upload program for Vendor master Partner Data in XK02 needed info
Hello Experts,
I need to write data uplaod program for XK02 for vendor master Partner functions. ( Basically we created some custom partner functions and attach it to many existing vendors ).
So kindly advice me which is the suitable upload method for this.
1) There is no BAPI available for editing vendors.
2) BDC is not possible because the Vendor partner screen is having table control and some records are already filled. (No of row not fixed).
Is there any IDOC available or any standard input pgm?
Please give suggestion.
Thanks and rgds,
AnandFor the IDOC perspective, you can uses CREMAS.
For the mass maintenance you still have XK99 (which also uses CREMAS internally)
True there is NO BAPI
For the BDC and the table control. Well this is not really true.
In batchinput, instead of maintaining the rows by there Number, you should select it at the first position.
OK-CODE /06 will open a selection screen SAPMF02K 2324. The result of the selection screen goes to the first line of the table control.
Of course this works only in BDC
reward points if helpful
Edited by: Alain Bacchi on Jun 18, 2008 8:48 AM -
Need upload program for Vendor master partners (XK02)
Hello Experts,
I need to write data uplaod program for XK02 for vendor master Partner functions. ( Basically we created some custom partner functions and attach it to many existing vendors ).
So kindly advice me which is the suitable upload method for this.
1) There is no BAPI available for editing vendors.
2) BDC is not possible because the Vendor partner screen is having table control and some records are already filled. (No of row not fixed).
Is there any IDOC available or any standard input pgm?
Please give suggestion.
Thanks and rgds,
AnandHi,
You can use LSMW --> Vendor Master which supports bothe XK01 and XK02.
This is a standard Batch input program (RFBIKR00). Look at this program documentation for more info.
Regards
Sudhir Atluru -
LSMW for Vendor Master (t-code XK01)
Hi guys,
I'm creating a LSMW for Vendor Master (t-code XK01) using direct input but the following error message appears:
In the step "Create batch input session", I get the following error:
FB012 Session 1 : Special character for 'empty field' is /
FB007 Session 1 session name VENDOR was opened
FB112 Trans. 1 : No transaction code was transferred
FB016 ... Last header record ...
FB014 ... BLF00-STYPE 1
FB014 ... BLF00-TCODE /
FB014 ... BLF00-LIFNR DETES998
FB014 ... BLF00-BUKRS /
FB014 ... BLF00-EKORG /
FB014 ... BLF00-KTOKK 0001
FB013 ....Editing was terminated
I mapped the TCODE filed using xk01 and the same error still displays; in the first step I select Object 0040, method 0002 and the program is RFBIKR00, is this correct?
Some of the fields are stored ina different table; How can I mapped this fileds?
Any you can provide will be great......Hi,
Are you getting this error immediatly or later half?
1. This could be with same Vendor number which would be existing in the system.
2. Data inconsistencies.
What are the flat files that you have is it a single file or more than one?
Thanks,
Prashanth -
Working on IDOC OUTBOUND FOR Vendor Master and Customer Master
Hi Group,
I need to create IDOC's for Vendor master and customer master using ALE. Whenever they create vendor/customer or changes to vendor/customer should create IDOC's.
Can anyone please help me out how to proceed? I know that we can use CREMAS/DEBMAS and CREMAS04/CREMAS...But I would like to know how to use those.
Thank-You,
VenkyHi Sai,
Welcome to group.
Related to CREMAS/DEBMAS, for your situation, you can use the change pointers. With this, when ever there is an change/create, it will create an entry in CDHDR & CDPOS and based on that it will create the IDOCs for these.
Activate the change pointers for these message types and run the application RBDMIDOC periodically (whenever you want). This application will create the IDOCs based on your entries.
To activate the change pointers, the TCODEs are
BD50 Checking change pointer is activated for Message Type
BD52 Checking which fields are configured change pointer to create. (please make sure, an entry will exist in BDCP table)
I hope you know the remaining configuration related to partner profile entries (WE20) i.e. to which system you want to send the idocs and Inbound or Outbound etc.
Let me know if you need further info.
shylesh -
What is the bdc program for vendor master?
what is the bdc program for vendor master?
Hi,
Find the code here.
And do create your text file data in the order of itab structure.
{report ZBDC_XK01
no standard page heading line-size 255.
data: bdcdata like bdcdata occurs 0 with header line.
data: begin of itab occurs 0,
lifnr like lfa1-lifnr,
bukrs like RF02K-bukrs,
ekorg like RF02K-ekorg,
ktokk like RF02K-ktokk,
anred like lfa1-anred,
name1 like lfa1-name1,
sortl like lfa1-sortl,
land1 like lfa1-land1,
spras like lfa1-spras,
waers like lfm1-waers,
end of itab.
selection-screen begin of block blk1 with frame.
parameters: p_file like rlgrap-filename OBLIGATORY.
selection-screen end of block blk1.
AT SELECTION-SCREEN ON VALUE-REQUEST FOR p_file.
perform f4_help_p_file.
start-of-selection.
perform get_data.
perform upload.
END-OF-SELECTION.
*& Form f4_help_p_file
text
--> p1 text
<-- p2 text
form f4_help_p_file .
data: v_file like p_file.
CALL FUNCTION 'F4_FILENAME'
IMPORTING
file_name = v_file.
CHECK sy-subrc EQ 0.
p_file = v_file.
endform. " f4_help_p_file
*& Form get_data
text
--> p1 text
<-- p2 text
form get_data .
data: s_file type string.
s_file = p_file.
CALL FUNCTION 'GUI_UPLOAD'
EXPORTING
filename = s_file
FILETYPE = 'ASC'
HAS_FIELD_SEPARATOR = 'X'
HEADER_LENGTH = 0
READ_BY_LINE = 'X'
DAT_MODE = 'D'
CODEPAGE = ' '
IGNORE_CERR = ABAP_TRUE
REPLACEMENT = '#'
CHECK_BOM = ' '
IMPORTING
FILELENGTH =
HEADER =
tables
data_tab = itab
EXCEPTIONS
FILE_OPEN_ERROR = 1
FILE_READ_ERROR = 2
NO_BATCH = 3
GUI_REFUSE_FILETRANSFER = 4
INVALID_TYPE = 5
NO_AUTHORITY = 6
UNKNOWN_ERROR = 7
BAD_DATA_FORMAT = 8
HEADER_NOT_ALLOWED = 9
SEPARATOR_NOT_ALLOWED = 10
HEADER_TOO_LONG = 11
UNKNOWN_DP_ERROR = 12
ACCESS_DENIED = 13
DP_OUT_OF_MEMORY = 14
DISK_FULL = 15
DP_TIMEOUT = 16
OTHERS = 17
IF sy-subrc <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
stop.
ENDIF.
endform. " get_data
*& Form upload
text
--> p1 text
<-- p2 text
form upload .
loop at itab.
perform bdc_dynpro using 'SAPMF02K' '0100'.
perform bdc_field using 'BDC_CURSOR'
'RF02K-KTOKK'.
perform bdc_field using 'BDC_OKCODE'
'/00'.
perform bdc_field using 'RF02K-LIFNR' itab-lifnr.
perform bdc_field using 'RF02K-BUKRS' '0001'.
perform bdc_field using 'RF02K-EKORG' '1000'.
perform bdc_field using 'RF02K-KTOKK' '0001'.
perform bdc_dynpro using 'SAPMF02K' '0110'.
perform bdc_field using 'BDC_CURSOR'
'LFA1-SPRAS'.
perform bdc_field using 'BDC_OKCODE'
'/00'.
perform bdc_field using 'LFA1-ANRED' itab-anred.
perform bdc_field using 'LFA1-NAME1' itab-name1.
perform bdc_field using 'LFA1-SORTL' itab-sortl.
perform bdc_field using 'LFA1-LAND1' itab-land1.
perform bdc_field using 'LFA1-SPRAS' itab-spras.
perform bdc_dynpro using 'SAPMF02K' '0120'.
perform bdc_field using 'BDC_CURSOR'
'LFA1-KUNNR'.
perform bdc_field using 'BDC_OKCODE'
'/00'.
perform bdc_dynpro using 'SAPMF02K' '0130'.
perform bdc_field using 'BDC_CURSOR'
'LFBK-BANKS(01)'.
perform bdc_field using 'BDC_OKCODE'
'=ENTR'.
perform bdc_dynpro using 'SAPMF02K' '0210'.
perform bdc_field using 'BDC_CURSOR'
'LFB1-AKONT'.
perform bdc_field using 'BDC_OKCODE'
'/00'.
perform bdc_dynpro using 'SAPMF02K' '0215'.
perform bdc_field using 'BDC_CURSOR'
'LFB1-ZTERM'.
perform bdc_field using 'BDC_OKCODE'
'/00'.
perform bdc_dynpro using 'SAPMF02K' '0220'.
perform bdc_field using 'BDC_CURSOR'
'LFB5-MAHNA'.
perform bdc_field using 'BDC_OKCODE'
'/00'.
perform bdc_dynpro using 'SAPMF02K' '0310'.
perform bdc_field using 'BDC_CURSOR'
'LFM1-WAERS'.
perform bdc_field using 'BDC_OKCODE'
'/00'.
perform bdc_field using 'LFM1-WAERS' itab-waers.
perform bdc_dynpro using 'SAPMF02K' '0320'.
perform bdc_field using 'BDC_CURSOR'
'RF02K-LIFNR'.
perform bdc_field using 'BDC_OKCODE'
'=ENTR'.
perform bdc_dynpro using 'SAPLSPO1' '0300'.
perform bdc_field using 'BDC_OKCODE'
'=YES'.
call transaction 'XK01' using bdcdata mode 'A'.
refresh bdcdata.
clear itab.
endloop.
endform. " upload
*& Form bdc_dynpro
text
-->P_0126 text
-->P_0127 text
form bdc_dynpro using program dynpro.
clear bdcdata.
bdcdata-program = program.
bdcdata-dynpro = dynpro.
bdcdata-dynbegin = 'X'.
append bdcdata.
endform. " bdc_dynpro
*& Form bdc_field
text
-->P_0316 text
-->P_0317 text
form bdc_field using fnam fval.
clear bdcdata.
bdcdata-fnam = fnam.
bdcdata-fval = fval.
append bdcdata.
endform. " bdc_field}
Reward points if you find it helpful
Thanks,
Prasanna -
Change Pointers for Vendor Master
Hi All,
I have to activate change pointers for Vendor Master data. I have some doubts regarding the same.
1. An Idoc will be generated for newly created vendor, right?
2. If I extend the vendor master IDOC, where should I write code to extract the values of newly added fields?
3. If I create a custom IDOC for vendor master, what is the procedure to configure this in the change pointers for Vendor Master?
Thanks & Best Regards,
Kumar.>
Sivapuram Phani Kumar wrote:
> Hi All,
>
> I have to activate change pointers for Vendor Master data. I have some doubts regarding the same.
>
> 1. An Idoc will be generated for newly created vendor, right?
> 2. If I extend the vendor master IDOC, where should I write code to extract the values of newly added fields?
> 3. If I create a custom IDOC for vendor master, what is the procedure to configure this in the change pointers for Vendor Master?
>
> Thanks & Best Regards,
> Kumar.
Hi,
1. Afer doing all the settings required to create change pointers (BD61, BD50, BD52), the idocs will be created when u run the report RBDMIDOC or execute transaction BD21.if any changes happen in master data
like new vendor is created or vendor data is changed, then only change pointers will be created and on executing the aforesaid report, idocs will be generated.
Also idocs can be generated by replicating vendor data through transaction BD14 or any other custom transaction.
2. When you add custom segments to basic type, you have to write code in suitable user exits.
Identify suitable user exit to populate data in custom segments and write the code in oubound side.
Identify suitable user exit to populate the values in custom segments to database table, this code is to be written in inbound side.
Regards
Vinod -
Report for vendor master changes
Good day,
Please can you assist with this issue,
Report S_ALR_87012089,program RFKABL00
Version ECC 6.0
This report does not reflect the old and the new values for changed bank details.
It does not show anything under the old value and shows **deleted** and **created** for new values.
Thanks in advanceYou will have to do configuration in T Codes OBAT and OBAU to achieve what you want in the report.
Check the IMG activity documentation for the following.
SPRO -> IMG -> Financial Accounting -> Accounts Receivable and Accounts Payable -> Vendor Accounts -> Master Records -> Preparations for Changing Vendor Master Records -> Define Field Groups for Vendor Master Records.
SPRO -> IMG -> Financial Accounting -> Accounts Receivable and Accounts Payable -> Vendor Accounts -> Master Records -> Preparations for Changing Vendor Master Records -> Group Fields for Vendor Master Records.
Also read the RFKABL00 program documentation.
Maybe you are looking for
-
Vendor outstanding against Purchase order
Hi Gurus, Is there any standard report in SAP where we can get vendor outstanding against purchase order . (Purchase order made,miro also made , but payment is still due ). How can we find or track the pending payment of vendor agai
-
HP Laserjet 1200 - time to upgrade?
I've had this HP LaserJet 1200 for years. Works great except on PDFs and image files. It takes forever to print each page on a multiple PDF for example. I also have a low end HP Deskjet 6940 which prints immediately. I assume it's a memory issue and
-
Creation of batch input session for mass reversal of payment documents
Hello FI experts, There is a business requirement in which the users want to reverse the payments en-masse. This can be achieved by creating a batch input session via a custom program to upload the documents from excel . Then calling FBRA and FB08 to
-
Year to Date reports using Prompts
Hi. I'm trying to build a report that will show results of sales compared to Annual targets. All those fields are fields directly at the opportunity level (amount and targets). I also need to put a prompt to select dates from and to, for the Opportun
-
XML TO .CSV Conversion issue
Hi All, I Developed an MDM to 3rd Party FTPscenario with FCC . The data from MDM comes as XML and i placed it at the FTP succesfully with .CSV format. But the issue is with tirmming of before Zeros in excel file, eg: The value of a field GTIN_No is 0