Handling expenses for 1099 vendors
Hi,
We are live with ECC 6.0 and have a requirement that the company business expenses, such as travel etc. that are paid out to 1099 vendors must NOT be included in the 1099 report at year end. In the old system, we handled this using two vendor master data created for every 1099 vendor, one to be used to enter expenses only and the other one for 1099 reporting. Does anyone have a solution for this problem in SAP using single vendor master data per 1099 vendor?
Thank you,
Kyung
Hi Sharabh,
Thanks again for your reply. I have two more questions:
Do you know whether there is a way to switch on Extended withholding tax functionality to make the MIRO transaction come up with the withholding tax detail tab?
Right now the withholding tax detail information is stored at the invoice header level. Is there anyway to make it at the line item level so that we can enter both expense items and 1099 compensation items in one invoice and specify withholding tax details at the line item level?
Thank you & best regards,
Kyung
Similar Messages
-
With holding tax base amount for 1099 vendors with discounted payment term
Hi Friends,
We have a below situation for 1099 vendors,
Some of the 1099 vendors are set-up in the system with payment term with discounts i.e. 2% if paid within 10 days
As per config, system posts with holding tax base amount at the time of posting payment.
With holding tax rate is 0%,
Based on modified net amount calculation
and
Cash discount calculation before w/tax calculation
When we have vendor with input tax, system excludes tax amount at the time of payment but for the with holding tax base calculation amount system does not exclude input tax type.
Which causes difference in 1099 misc vendors
Below is the example of how system calculates the amount.
Invoice $ 1000, payment term 2% if paid within 10 days. Input tax 7.25%
Payment going out=
$1000- $ 72.5(tax 7.25%) = $ 927.5 18.55 [2% discount] = $ 908.95 (payment amount)
With holding base calculation =
$ 1000 100 (2% discount) = $ 900
Difference between payment going out and with holding tax base = 908.98 900 = 8.98
Can some one please tell me how to get rid off this difference?
Moreover, please tell me if its normal to have 1099 vendors with discounted payment term.
Any thoughts on above situation will be helpful
Edited by: Shefford William on Jan 28, 2008 11:36 PMDear All
i am also having the same problem. The example is
Net invoice Value = $ 100,000
Input Tax @ 15% = $ 15,000
Total Invoice Value = $ 115,000
Cash Discount = 20% with in 20 days
On payment the system behavior should be
Debit Vendor invoice Value = $ 115,000
Debit Cash Discount @ 20% = $ 20,000 ( 20% of the Net Invoice Value that is 20% of $ 100,000)
Credit W/H Tax deduction @ 3.5% = $ 3,325 ( 3.5% of 95,000 the Inv Value - Cash Discount that is $ 115,000 - $20,000)
Credit Bank Account = $ 91,675 ( Inv value - Cash Dic - W/H tax that is $ 115,000 - 20,000 - 3325 = 91,675)
However at the time of payment system is calculating tax as follows
Debit Vendor invoice Value = $ 115,000
Debit Cash Discount @ 20% = $ 20,000 ( 20% of the Net Invoice Value that is 20% of $ 100,000)
Credit W/H Tax deduction @ 3.5% = $ 3,220 ( 3.5% of 92,000 the Inv Value - Cash Discount that is $ 115,000 - $23,000. This $ 23,000 is only calculated for W/H tax calculation that is 20% of $ 115,000 )
Credit Bank Account = $ 91,780 ( Inv value - Cash Dis - W/H tax that is $ 115,000 - 20,000 - 3220 = 91,780)
this is not the common practice when using the net base value in the system.
Can any one help me in this regard. I really have been stucked in this problem for many days
Regards
Bilal Athar -
Is there a need to activate Withholding tax functionality when creating or reporting 1099 vendors if there is no tax withheld?
Can we just create the 1099 by filling the fields of tax numbers ? Is there anything else that is reqquired for creating 1099 vendor?Hi
for details on this 1099 MISC reporting. SAP Note No. 363650 clearly explains how to configure this. As not everyone seems to be having access to this note, I thought of reproducing it here. At the end, vendor master maintenance for 1099 vendors also is covered, which is not a part of the SAP Note.
A) How to configure extended withholding tax to get correct 1099MISC reporting?
1) Define a type:Go to IMG path:-> Financial Accounting Global Settings -> Withholding Tax -> Extended Withholdng Tax -> Calculation -> Withholding Tax Type -> Define Withholding Tax Type for Payment Posting
Define one withholding tax type for 1099 federal reporting. If state withholding tax needs to be withheld, a second withholding tax type needs to be created to allow two withholding tax postings for one vendor.
2) Define a code:
Go to IMG path: -> Financial Accounting Global Setting -> Withholding Tax -> Extended Withholdng Tax -> Calculation -> Withholding Tax Code -> Define Withholing Tax Code
Define one code for each box of the 1099MISC form where a base amount needs to be reported.
The codes must have the following numbering to get correct reporting:
TYPE CODE DESCRIPTION W/T PERCENTAGE
FE 01 Rents 0%
FE 02 Royalties 0%
FE 03 Other Income 0%
FE 05 Fishing boat proceeds 0%
FE 06 Medical and health care payments 0%
FE 07 Nonemployee compensation 0%
FE 08 Substitute payment in lieu of dividends 0%
FE 09 Direct Sales to a buyer for resale 0%
FE 10 Crop insurance proceeds 0%FE 3b or 13 Excess golden parachute 0%
FE 3c or 14 Gross proceeds to an attorney 0%
FE 7b Section 409A income 0%
FE 15 Section 409A deferrals 0%
Base amount, percentage to tax : 100 %
Postings, Post.indic. 1
Calculation, With/tax rate: leave blank
If tax must be withheld, a new code must be created starting with an F. Example F1 for rents. In this case fill the followig field as follows:
Calculation, With/tax rate: 30%
The codes for tax rate 30% should look as follows:
TYPE CODE DESCRIPTION W/T PERCENTAGE
FE F1 Rents 30%
FE F2 Royalties 30%
FE F3 Other Income 30%
FE F5 Fishing boat proceeds 30%
FE F6 Medical and health care payments 30%
FE F7 Nonemployee compensation 30%
FE F8 Substitute payment in lieu of dividends 30%
FE F9 Direct Sales to a buyer for resale 30%
FE F0 Crop insurance proceeds 30%
FE Fb Excess golden parachute 30%
FE Fc Gross proceeds to an attorney 30%
FE Fd Section 409A deferrals 30%
FE Fe Section 409A inocme 30%
If state tax must be withheld, assign a second type to the company code as follows:
TYPE CODE DESCRIPTION W/T PERCENTAGE
ST 16 State tax withheld depending on state
3) Assign Withholding Tax Types to Company Code:
Go to IMG path: -> Financial Accounting -> Financial Accounting Global Settings -> Withholding Tax -> Extended Withholding Tax -> Company Code -> Assign Witholding Tax Types to Company Code
Switch on: Vendor data, With/tax agent and fill the validity period.
4) Assign an Account:
Go to IMG path: -> Financial Accounting -> Financial Accounting Global Settings -> Withholding Tax -> Extended Wtihholding Tax -> Postings -> Account for Withholding Tax -> Define Accounts for Withholding Tax to be paid over
B) How to configure classical withholding tax for 1099MISC reporting
1) Define a code
Go to IMG path: -> Financial Accounting Global Settings -> Withholding Tax -> Withholding Tax -> Calculation -> Maintain Tax Codes
Define one code for each box of the 1099MISC form where a base amount needs to be reported.
The codes must have the following numbering to get correct reporting (2001 reporting):
CODE DESCRIPTION
01 Rents
02 Royalties
03 Other Income
05 Fishing Boat Proceeds
06 Medical and health care payments
07 Nonemployee compensation
08 Substitute payments in lieu of dividends or interest
09 Direct Sales to a buyer for resale
10 Crop Insurance proceeds
13 or 3B Excess Golden parachute
14 or 3c Gross proceeds paid to an attorney
7B Section 409A income
15 Section 409A deferrals
Percentage subject to tax : 100 %
Mark box :Posting with the payment.
If tax must be withheld, a new code must be created starting with an F, Example F1 for Rents. In this case fill the fields as follows:
CODE DESCRIPTIOn
F1 Rents
F2 Royalties
F3 Other Income
F5 Fishing boat proceeds
F6 Medical and health care payments
F7 Nonemployee compensation
F8 Substitute payment in lieu of dividends
F9 Direct Sales to a buyer for resale
F0 Crop Insurance Proceeds
FB Excess golden parachute
FC Gross proceeds to an attorney
FD Section 409A deferrals
FE Section 409A income
Percentage subject to tax: 100%
Withholding tax rate: 30% (or valid rate for reporting year)
Mark box: Posting with payment
To flag a vendor in SAP as a 1099 vendor, two fields need to be populated.
1. On the Control screen of the vendor master, populate either "Tax Code 1" field with vendor's Social Security Number or ITIN if it is an individual or "Tax Code 2" field with his corporate tax ID for corporate vendors. The format for SSN/ITIN is xxx-xx-xxxx and corporate tax ID is xx-xxxxxxx.
2. On the Accounting Info. screen, populate the "W.tax code" field under the "Withholding Tax" box.
Any posts done before this changes were implemented will not show on 1099. You will need to run program RFWT0020 to flag 1099 items retroactively.
If the withholding tax base amount and/or the withholding tax code needs to be changed after an invoice has been cleared please follow the procedure below:
1) Change Document Change Rules
Go to IMG -> Financial Accounting Global Settings -> Document -> Line Item -> Document Change Rules
Go to account Type K field name BSEG-QSSHB and click off Line item not cleared.
Go to account Type K field name BSEG-QSSKZ and click off Line item not cleared.
2) Change Document Change Rules for extended withholding tax
Go to IMG -> Financial Accounting Global Settings -> Line Item -> Document Change Rules
Go to account Type K field name
Go to field WITH_ITEM-WT_QSSHB and click on 'Field can be changed'
Go to field WITH_ITEM-WT_WITHCD and click on 'Field can be changed'
3) Change Witholding Tax Code
Go to IMG -> Financial Accounting Global Settings -> Withholding Tax -> Withholding Tax -> Calculation -> Check witholding tax codes
Go to the respective withholding tax code and click off Posting with payment.
4) Change the payment document of the invoice which needs to be changed.
5) Your changed documents will be selected with report RFW1099M
Please reward points if helpful!!!
Thanks -
Please try to understand my question here. I am not asking where is the integration point between AP and payroll, I know it is the personnel number entered in vendor master.
Here is the scenario. Payroll in SAP maintains the withholding taxes calculation for 1099 vendors. Some 1099 vendors are paid through payroll, while some outside SAP through some external AP software. If I run the 1099 report in AP in SAP , will it pick up the 1099 vendors (since the withholding tax calculation is doen in payroll)??? Do I need to do any configuration in Withholding taxes under "Financial Accounting Global settins" in SPRO or not.
Second question, do I have to activate withholding taxes in this scenario or not. If yes, should it be activated after conversion or before.
Also during conversion, do I need to bring over the values of withholding tax codes like 7, 16 etc in vendor master or not. Do I need to give them in LSMW mapping of conversion of vendor master or not???
ThanxHi,
A vendor to whom an agency must report payment for goods or services to the Internal Revenue Service (IRS).
To flag a vendor in SAP as a 1099 vendor, two fields need to be populated.
1. On the Control screen of the vendor master, populate either "Tax Code 1" field with his social security number if his social security number is his tax id. or "Tax Code 2" field with his corporate tax id. if he has been issued a corporate tax id. Input either of the two in their correct format i.e. social security as xxx-xx-xxxx or corporate id as xx-xxxxxxx.
2. On the Accounting Info. screen, populate the "W.tax code" field under the "Withholding Tax" box with the value "07" if it is a US vendor or "42" if it is a foreign vendor.
These are the two fields that specify a vendor as being a 1099 vendor.
Any posts done before this changes were implemented will not show on 1099.
You will need to run program RFWT0020 to flag 1099 items retroactively.
...and/or you can change the "Document Change rules" for BSEG-QSSHB and BESG-QSSKZ for account type "K" so that you can change the Withholding tax code after the line item has been cleared (i.e. after entering the required information in the vendor master record as the user above has recommended) (Refer to OSS Note: 363650).
But if you use MIRO to post invoices, you might want to look at Note 482245 too...
Check the link - http://www.sap-img.com/financial/1099-misc.htm
<i><b>* Pls. assign points, if useful as promised :)</b></i>
regards,
Sridevi
Message was edited by:
Sridevi -
Some 1099 vendors get "No records were selected" RFIDYYWT RFW1099M
Hello People,
I have a problem with 1099 output with programs like RFIDYYWT and RFW1099M as I have done all the customizing settings for 1099 vendors in vendor master like setting up WH tax code and filling up tax number field xx-xxxxxxx in order to execute and print 1099 MISC form through RFIDYYWT program but to my surprise I was able to get output with posted invoices for some vendors but for some other vendors it says " No records were selected" eventhough there are posted invoices against them....I am confused ..any idea why this is happening?
Regards,
BobHi Bob,
Even though your configuration seems to be correct, also check as to whether you have correctly assigned the WH codes etc in the vendor masters. Also check whether such WH codes and types are correctly populating at the document line item level.
Hope this helps.
Vikas. -
Hello,
Kindly let me know the procedures to print misc forms for 1099 vendors for the beginning of 2009.
We have a bunch of 1099 vendors. I have never worked on this before so will apHello,
If you want to print the 1099 report with the 2008 layout you have to
implement the note 1279366 by importing the transport files.
To implement the changes please import the attached transports. The
transports contain the following files:
IDWTFILE_US_1099
IDWTFILE_US_1099G
IDWTFILE_US_1099INT
IDDEBT_1099C
and the following forms:
IDWTCERT_US_1099MISC
IDWTCERT_US_1099MISC1
IDWTCERT_US_1099G
IDWTCERT_US_1099INT
IDDEBT_1099C
If you have any issues with the transports please refer to the following
Notes: 480180 and 13719 which explains how to apply Attached transports.
Extra info:
The report RFW1099M, are valid only up to release 4.6C; from release,
the customer should use the report RFIDYYWT.
We suggest to customers to use the RFIDYYWT program in 470->. This
program has all the updates for legal changes.
The RFW1099M is used by customers in lower release. In 470 release norm-
ally we provide changes to RFIDYYWT.
Please read the documentation of the report through Trx SE38.The report
contains all the new legal requirements - This does not necessarily mean
that your Customer/Vendor set-up needs to be changed.
The forms IDWTCERT_1099MISC ... all exists in your system.
You can see them in transaction code: smartforms
Please note that in the output group configuration for RFIDYYWT report
program you can configure 'TWO' forms.
The 'FIRST' form as 'IDWTCERT_US_1099MISC' and the 'SECOND' form as
'IDWTCERT_US_1099MISC1.
The first form always print 2 vendors per page and the second form alway
prints a vendor twice in a single page as the requirement is, for copy A
and copy B of IRS 1099 filing.
Hope that helps,
Jon -
1099 payments are not combined for same vendor payments
Hi All
I have a question on 1099 reporting.
My issue is that we are running the report in transaction code s_p00_07000134 separately by company code because all these company codes have separate tax ids except few of them which have same tax ids. My client wants to run them (ccodes with same tax ids) together and if there is a same vendor on these company codes . They are being shown on the report separately and the 1099 forms are printing separately.
Cant the system combine the payments for same vendors under different company codes with same tax ids run together/
Please help me ..Hello,
Did you get the answer for this problem? Could you please explain how did you resolve it?
Thanks -
1099 Printout 2 copies for each vendor
SAP Gurus,
I am trying to run 1099 forms, I am using tcode S_P00_07000134 - Generic Withholding Tax Reporting.
When I run program I only see Copy B, which is for the vendors records, I will still need Copy A in order to send to Federal. Does anyone knows the process? We implemented all the OSS notes possible related for 2008, but it appears that SAP scanned double copies in one page both copies are Receipient.
When I run tcode I don't even get form 1096 which is part of 1099 process.
Is anyone having the same issue?
Edited by: Frank on Jan 28, 2009 10:49 PMHi manjula
In order to get total for any key figure .... for that key figure at the query level in the calculation tab there will be one box like calculate result as there u give sum or average accroding to ur purpose... then it will display the total or average accordingly....
the key figure when used average for result shows average of all record conrtibutions but
In order to display the percentage of each vendor from total u can use
Percentage Share of Result (%CT)
%CT<Operand>
Specifies how high the percentage share is in relation to the result. The result
means the result of aggregation at the next level (interim result).
%CT Incoming Orders specifies the share of incoming order values of each
individual characteristic value (for example of each customer) in relation to
the characteristic's result (for example, customer of a division).
Regards
vamsi -
Hi,
User requirement here is , they want to use 1099 for certain vendors like contractors, some employees without the withholding tax code. Could anyone suggest me how to do this in vendor master records.
ThanksHiya,
This might help:
http://www.sap-img.com/financial/1099-misc.htm
http://www.copacustomhelp.state.pa.us/infopak/content/fiap_y_dc1_32000315/wi/html/index.htm
Cheers. -
We have a set of external vendors that are NOT set up in SAP. Is there a way to create a 1099 form for these vendors using S_P00_07000134, but without setting them up as a vendor in SAP? Is there a user exit (or something) that could capture this non-SAP vendor information before it is sent to the smartform?
Hi Leslie,
I also had the same requirement like few tax amount for a particular vendor is present in SAP and the remaining entries are present in the legacy system and we are asked to combine both the tax amounts from the SAP and the legacy syatem and disply in the 1099 form and i solved it. I am giving you the steps i took to solve it.
1). Each SAP vendor (LIFNR) is linked with a legacy vendor(ALTKN) in table LFB1. Check for which SAP vendor your legacy vendor is linked.
2). Create a custom table which has the key fields as SAP_LIFNR, LEG_LIFNR, WITHT and two other fields WT_WITHCD and the amount field.
3). Now copy the Smartform which is used to the "Z" smartform. Inside which you can add the logic to display the legacy vendor details along with the Standard SAP vendor details.
and also change the configuration of the smartform to the transaction using spro as shown in the screen shot.
[http://picasaweb.google.com/103286534972377930456/SAP#5563430033050835330] -
Balance Confirmation Report for multiple vendors
Hi all,
I have developed report in FI which gives details about opening balance,fiscal year, document number, posting date and amount in the output.In selection screen I am passing single values of fiscal year(GJAHR), vendor(LIFNR) and company code(BUKLRS). This report is working fine for single vendor but now I need to change it for multiple vendors. I tried but not getting desired result in the output.
Following is code for single vendor in selection screen.
SORT t_bsikbsak BY bukrs belnr gjahr buzei.
LOOP AT t_bsikbsak.
t_pre_bal-netpr = t_bsikbsak-dmbtr.
t_pre_bal-sgtxt = 'Opening Balance'.
IF t_bsikbsak-shkzg EQ 'H'.
t_pre_bal-netpr = t_pre_bal-netpr * -1.
ENDIF.
COLLECT t_pre_bal.
ENDLOOP.
LOOP AT t_pre_bal.
itab-netpr = t_pre_bal-netpr.
itab-sgtxt = t_pre_bal-sgtxt.
APPEND itab.
ENDLOOP.
SORT t_bseg BY bukrs belnr gjahr buzei.
CLEAR itab.
LOOP AT t_bseg.
ON CHANGE OF t_bseg-bukrs OR t_bseg-belnr OR t_bseg-gjahr.
READ TABLE t_bkpf WITH KEY bukrs = t_bseg-bukrs
belnr = t_bseg-belnr
gjahr = t_bseg-gjahr.
IF sy-subrc IS INITIAL.
itab-budat = t_bkpf-budat.
itab-belnr = t_bkpf-belnr.
itab-gjahr = t_bkpf-gjahr.
ENDIF.
ENDON.
IF t_bseg-koart = 'K' AND t_bseg-lifnr = s_lifnr.
itab-sgtxt = t_bseg-sgtxt.
READ TABLE t_bsak WITH KEY bukrs = t_bseg-bukrs
belnr = t_bseg-belnr
gjahr = t_bseg-gjahr.
IF t_bseg-shkzg EQ 'H'.
t_bseg-dmbtr = t_bseg-dmbtr * -1.
ENDIF.
itab-netpr = itab-netpr + t_bseg-dmbtr.
ELSEIF t_bseg-hkont = '0044100040'. " G/L for INTEREST EXPENSES
itab-inamt = t_bseg-dmbtr.
ELSEIF t_bseg-hkont = '0012300060'. " G/L for TDS ON INTEREST
itab-tdamt = t_bseg-dmbtr.
ENDIF.
AT END OF bukrs.
append_flag = 'X'.
ENDAT.
AT END OF belnr.
append_flag = 'X'.
ENDAT.
AT END OF gjahr.
append_flag = 'X'.
ENDAT.
IF append_flag = 'X'.
APPEND itab.
CLEAR itab.
CLEAR : append_flag.
ENDIF.
ENDLOOP.
Closing Balance
LOOP AT itab.
t_temp-netpr = itab-netpr.
t_temp-sgtxt = 'Closing Balance'.
COLLECT t_temp.
ENDLOOP.
CLEAR itab.
LOOP AT t_temp.
itab-netpr = t_temp-netpr.
itab-sgtxt = 'Closing Balance'.
APPEND itab.
ENDLOOP.
Kindly provide some input how to do it for multiple vendors in same code otherwise provide some suggestions for new code.
Thanks in Advance.waiting for response.
Thanks & Regards,
Harshada PatilHi,
Thanks for quick response.Following is the structure of internal tables which I am using in this program.
TYPES : BEGIN OF ty_bsikbsak ,
bukrs TYPE bsik-bukrs,
lifnr TYPE bsik-lifnr,
umsks TYPE bsik-umsks,
umskz TYPE bsik-umskz,
augdt TYPE bsik-augdt,
augbl TYPE bsik-augbl,
gjahr TYPE bsik-gjahr,
belnr TYPE bsik-belnr,
buzei TYPE bsik-buzei,
zuonr TYPE bsik-zuonr,
shkzg TYPE bsik-shkzg,
dmbtr TYPE bsik-dmbtr,
END OF ty_bsikbsak.
TYPES : BEGIN OF ty_bkpf ,
bukrs TYPE bkpf-bukrs,
belnr TYPE bkpf-belnr,
gjahr TYPE bkpf-gjahr,
bldat TYPE bkpf-bldat,
budat TYPE bkpf-budat,
stblg TYPE bkpf-stblg,
stjah TYPE bkpf-stjah,
END OF ty_bkpf.
TYPES : BEGIN OF ty_bseg ,
bukrs TYPE bseg-bukrs,
belnr TYPE bseg-belnr,
gjahr TYPE bseg-gjahr,
buzei TYPE bseg-buzei,
koart TYPE bseg-koart,
shkzg TYPE bseg-shkzg,
dmbtr TYPE bseg-dmbtr,
sgtxt TYPE bseg-sgtxt,
hkont TYPE bseg-hkont,
lifnr TYPE bseg-lifnr,
END OF ty_bseg.
DATA : t_bsik TYPE TABLE OF ty_bsikbsak WITH HEADER LINE.
DATA : t_bsak TYPE TABLE OF ty_bsikbsak WITH HEADER LINE.
DATA : t_bsikbsak TYPE TABLE OF ty_bsikbsak WITH HEADER LINE.
DATA : t_bkpf TYPE TABLE OF ty_bkpf WITH HEADER LINE.
DATA : t_bkpf2 TYPE TABLE OF ty_bkpf WITH HEADER LINE.
DATA : wa_bkpf TYPE ty_bkpf .
DATA : t_bseg TYPE TABLE OF ty_bseg WITH HEADER LINE.
DATA: BEGIN OF t_pre_bal OCCURS 0,
netpr TYPE bseg-dmbtr,
sgtxt TYPE bseg-sgtxt,
lifnr TYPE bseg-lifnr,
END OF t_pre_bal.
DATA: t_pre_bal1 LIKE t_pre_bal.
DATA: BEGIN OF t_temp OCCURS 0,
netpr TYPE bseg-dmbtr,
sgtxt TYPE bseg-sgtxt,
lifnr TYPE bseg-lifnr,
END OF t_temp.
DATA: BEGIN OF itab OCCURS 0,
gjahr LIKE bsik-gjahr,
belnr LIKE bsik-belnr,
budat LIKE bkpf-budat,
sgtxt LIKE bseg-sgtxt,
lifnr LIKE lfa1-lifnr,
netpr LIKE bseg-dmbtr, " Net Amount
inamt LIKE bseg-dmbtr, " Interest Amount
tdamt LIKE bseg-dmbtr, " TDS Amount
END OF itab.
RANGES: r_budat FOR bkpf-budat.
I have Included vendor(LIFNR) in all these structures.Now I am using three internal tables to hold opening balance, Closing balance and line item accounting documents from bseg table respectively.here, I need to collect all these three internal tables into one internal table according to vendor(LIFNR) with it's opening balance, accounting documents and closing balance. can anyone guide me through this so that I can collect all these three internal tables into single one.
Thanks & Regards,
Harshada Patil
Edited by: Harshada.up on Feb 15, 2011 9:33 AM -
I Need Interactive Report for displaying vendor information. Based on the s
Interactive Report for displaying vendor information. Based on the selection made by the corresponding Vendor Bank Details are listed such that the line selected in the basic list was visible along with the secondary list.
hi
Hi
Use the Table LFA1 and LFB1 in the basic list
and LFBK table details in the secondary list
see the sample code related to customer Sales orders
modify it with the Vendor tables
REPORT ZTEJ_INTAB1 LINE-SIZE 103 LINE-COUNT 35(5) NO STANDARD PAGE
HEADING.
*TABLES DECLARATION
TABLES : KNA1, VBAK, VBAP.
*SELECT OPTIONS
SELECT-OPTIONS: CUST_NO FOR KNA1-KUNNR.
*INITIALIZATION
INITIALIZATION.
CUST_NO-LOW = '01'.
CUST_NO-HIGH = '5000'.
CUST_NO-SIGN = 'I'.
CUST_NO-OPTION = 'BT'.
APPEND CUST_NO.
*SELECTION SCREEN VALIDATION
AT SELECTION-SCREEN ON CUST_NO.
LOOP AT SCREEN.
IF CUST_NO-LOW < 1 OR CUST_NO-HIGH > 5000.
MESSAGE E001(ZTJ1).
ENDIF.
ENDLOOP.
*BASIC LIST SELECTION
START-OF-SELECTION.
SELECT KUNNR NAME1 ORT01 LAND1 INTO
(KNA1-KUNNR, KNA1-NAME1,KNA1-ORT01,KNA1-LAND1)
FROM KNA1
WHERE KUNNR IN CUST_NO.
WRITE:/1 SY-VLINE,
KNA1-KUNNR UNDER 'CUSTOMER NO.' HOTSPOT ON,
16 SY-VLINE,
KNA1-NAME1 UNDER 'NAME',
61 SY-VLINE,
KNA1-ORT01 UNDER 'CITY',
86 SY-VLINE,
KNA1-LAND1 UNDER 'COUNTRY',
103 SY-VLINE.
HIDE: KNA1-KUNNR.
ENDSELECT.
ULINE.
*SECONDARY LIST ACCESS
AT user-command.
IF SY-UCOMM = 'IONE'.
PERFORM SALES_ORD.
ENDIF.
IF SY-UCOMM = 'ITWO'.
PERFORM ITEM_DET.
ENDIF.
*TOP OF PAGE
TOP-OF-PAGE.
FORMAT COLOR 1.
WRITE : 'CUSTOMER DETAILS'.
FORMAT COLOR 1 OFF.
ULINE.
FORMAT COLOR 3.
WRITE : 1 SY-VLINE,
3 'CUSTOMER NO.',
16 SY-VLINE,
18 'NAME',
61 SY-VLINE,
63 'CITY',
86 SY-VLINE,
88 'COUNTRY',
103 SY-VLINE.
ULINE.
FORMAT COLOR 3 OFF.
*TOP OF PAGE FOR SECONDARY LISTS
TOP-OF-PAGE DURING LINE-SELECTION.
*TOP OF PAGE FOR 1ST SECONDARY LIST
IF SY-UCOMM = 'IONE'.
ULINE.
FORMAT COLOR 1.
WRITE : 'SALES ORDER DETAILS'.
ULINE.
FORMAT COLOR 1 OFF.
FORMAT COLOR 3.
WRITE : 1 SY-VLINE,
3 'CUSTOMER NO.',
16 SY-VLINE,
18 'SALES ORDER NO.',
40 SY-VLINE,
42 'DATE',
60 SY-VLINE,
62 'CREATOR',
85 SY-VLINE,
87 'DOC DATE',
103 SY-VLINE.
ULINE.
ENDIF.
FORMAT COLOR 3 OFF.
*TOP OF PAGE FOR 2ND SECONDARY LIST
IF SY-UCOMM = 'ITWO'.
ULINE.
FORMAT COLOR 1.
WRITE : 'ITEM DETAILS'.
ULINE.
FORMAT COLOR 1 OFF.
FORMAT COLOR 3.
WRITE : 1 SY-VLINE,
3 'SALES ORDER NO.',
40 SY-VLINE,
42 'SALES ITEM NO.',
60 SY-VLINE,
62 'ORDER QUANTITY',
103 SY-VLINE.
ULINE.
ENDIF.
FORMAT COLOR 3 OFF.
*END OF PAGE
END-OF-PAGE.
ULINE.
WRITE :'USER :',SY-UNAME,/,'DATE :', SY-DATUM, 85 'END OF PAGE:',
SY-PAGNO.
SKIP.
*& Form SALES_ORD
*& FIRST SECONDARY LIST FORM
FORM SALES_ORD .
SELECT KUNNR VBELN ERDAT ERNAM AUDAT INTO
(VBAK-KUNNR, VBAK-VBELN, VBAK-ERDAT, VBAK-ERNAM, VBAK-AUDAT)
FROM VBAK
WHERE KUNNR = KNA1-KUNNR.
WRITE:/1 SY-VLINE,
VBAK-KUNNR UNDER 'CUSTOMER NO.' HOTSPOT ON,
16 SY-VLINE,
VBAK-VBELN UNDER 'SALES ORDER NO.' HOTSPOT ON,
40 SY-VLINE,
VBAK-ERDAT UNDER 'DATE',
60 SY-VLINE,
VBAK-ERNAM UNDER 'CREATOR',
85 SY-VLINE,
VBAK-AUDAT UNDER 'DOC DATE',
103 SY-VLINE.
HIDE : VBAK-VBELN.
ENDSELECT.
ULINE.
ENDFORM. " SALES_ORD
*& Form ITEM_DET
*& SECOND SECONDARY LIST FORM
FORM ITEM_DET .
SELECT VBELN POSNR KWMENG INTO
(VBAP-VBELN, VBAP-POSNR, VBAP-KWMENG)
FROM VBAP
WHERE VBELN = VBAK-VBELN.
WRITE : /1 SY-VLINE,
VBAP-VBELN UNDER 'SALES ORDER NO.',
40 SY-VLINE,
VBAP-POSNR UNDER 'SALES ITEM NO.',
60 SY-VLINE,
VBAP-KWMENG UNDER 'ORDER QUANTITY',
103 SY-VLINE.
ENDSELECT.
ULINE.
ENDFORM. " ITEM_DET
REPORT demo_list_at_pf.
START-OF-SELECTION.
WRITE 'Basic List, Press PF5, PF6, PF7, or PF8'.
AT pf5.
PERFORM out.
AT pf6.
PERFORM out.
AT pf7.
PERFORM out.
AT pf8.
PERFORM out.
FORM out.
WRITE: 'Secondary List by PF-Key Selection',
/ 'SY-LSIND =', sy-lsind,
/ 'SY-UCOMM =', sy-ucomm.
ENDFORM.
After executing the program, the system displays the basic list. The user can press the function keys F5 , F6 , F7 , and F8 to create secondary lists. If, for example, the 14th key the user presses is F6 , the output on the displayed secondary list looks as follows:
Secondary List by PF-Key Selection
SY-LSIND = 14
SY-UCOMM = PF06
Example for AT USER-COMMAND.
REPORT demo_list_at_user_command NO STANDARD PAGE HEADING.
START-OF-SELECTION.
WRITE: 'Basic List',
/ 'SY-LSIND:', sy-lsind.
TOP-OF-PAGE.
WRITE 'Top-of-Page'.
ULINE.
TOP-OF-PAGE DURING LINE-SELECTION.
CASE sy-pfkey.
WHEN 'TEST'.
WRITE 'Self-defined GUI for Function Codes'.
ULINE.
ENDCASE.
AT LINE-SELECTION.
SET PF-STATUS 'TEST' EXCLUDING 'PICK'.
PERFORM out.
sy-lsind = sy-lsind - 1.
AT USER-COMMAND.
CASE sy-ucomm.
WHEN 'FC1'.
PERFORM out.
WRITE / 'Button FUN 1 was pressed'.
WHEN 'FC2'.
PERFORM out.
WRITE / 'Button FUN 2 was pressed'.
WHEN 'FC3'.
PERFORM out.
WRITE / 'Button FUN 3 was pressed'.
WHEN 'FC4'.
PERFORM out.
WRITE / 'Button FUN 4 was pressed'.
WHEN 'FC5'.
PERFORM out.
WRITE / 'Button FUN 5 was pressed'.
ENDCASE.
sy-lsind = sy-lsind - 1.
FORM out.
WRITE: 'Secondary List',
/ 'SY-LSIND:', sy-lsind,
/ 'SY-PFKEY:', sy-pfkey.
ENDFORM.
<b>Vendor performance report</b>
See this sample code
*"Table declarations...................................................
TABLES:
EKKO, " Purchasing Document Header
CDHDR, " Change document header
SSCRFIELDS. " Fields on selection screens
*"Selection screen elements............................................
SELECT-OPTIONS:
S_EBELN FOR EKKO-EBELN, " Purchasing Document Number
S_LIFNR FOR EKKO-LIFNR, " Vendor's account number
S_EKGRP FOR EKKO-EKGRP, " Purchasing group
S_BEDAT FOR EKKO-BEDAT, " Purchasing Document Date
S_UDATE FOR CDHDR-UDATE. " Creation date of the change
" document
*" Data declarations...................................................
Field String to hold Purchase Document Number *
DATA:
BEGIN OF FS_EBELN,
EBELN(90) TYPE C, " Purchase Document Number
ERNAM TYPE EKKO-ERNAM, " Name of Person who Created
" the Object
LIFNR TYPE EKKO-LIFNR, " Vendor's account number
EKGRP TYPE EKKO-EKGRP, " Purchasing group
BEDAT TYPE EKKO-BEDAT, " Purchasing Document Date
END OF FS_EBELN,
Field String to hold Purchase Document Header *
BEGIN OF FS_EKKO,
EBELN TYPE EKKO-EBELN, " Purchasing Document Number
ERNAM TYPE EKKO-ERNAM, " Name of Person who Created the
" Object
LIFNR TYPE EKKO-LIFNR, " Vendor's account number
EKGRP TYPE EKKO-EKGRP, " Purchasing group
BEDAT TYPE EKKO-BEDAT, " Purchasing Document Date
END OF FS_EKKO,
Field String to hold Account Number and name of the Vendor *
BEGIN OF FS_LFA1,
LIFNR TYPE LFA1-LIFNR, " Account Number of Vendor
NAME1 TYPE LFA1-NAME1, " Name1
END OF FS_LFA1,
Field String to hold Change date and the name of the user *
BEGIN OF FS_CDHDR,
OBJECTCLAS TYPE CDHDR-OBJECTCLAS, " Object Class
OBJECTID TYPE CDHDR-OBJECTID, " Object value
CHANGENR TYPE CDHDR-CHANGENR, " Document change number
USERNAME TYPE CDHDR-USERNAME, " User name
UDATE TYPE CDHDR-UDATE, " Creation date of the change
" document
END OF FS_CDHDR,
Field String to hold Change document items *
BEGIN OF FS_CDPOS,
OBJECTCLAS TYPE CDPOS-OBJECTCLAS," Object class
OBJECTID(10) TYPE C, " Object Value
CHANGENR TYPE CDPOS-CHANGENR, " Document change number
TABNAME TYPE CDPOS-TABNAME, " Table Name
FNAME TYPE CDPOS-FNAME, " Field Name
VALUE_NEW TYPE CDPOS-VALUE_NEW, " New contents of changed field
VALUE_OLD TYPE CDPOS-VALUE_OLD, " Old contents of changed field
END OF FS_CDPOS,
Field String to hold Date Element Name *
BEGIN OF FS_DATAELE,
TABNAME TYPE DD03L-TABNAME, " Table Name
FIELDNAME TYPE DD03L-FIELDNAME, " Field Name
ROLLNAME TYPE DD03L-ROLLNAME, " Data element (semantic domain)
END OF FS_DATAELE,
Field String to hold Short Text of the Date Element *
BEGIN OF FS_TEXT,
ROLLNAME TYPE DD04T-ROLLNAME, " Data element (semantic domain)
DDTEXT TYPE DD04T-DDTEXT, " Short Text Describing R/3
" Repository Objects
END OF FS_TEXT,
Field String to hold data to be displayed on the ALV grid *
BEGIN OF FS_OUTTAB,
EBELN TYPE EKKO-EBELN, " Purchasing Document Number
ERNAM TYPE EKKO-ERNAM, " Name of Person who Created the
" Object
LIFNR TYPE EKKO-LIFNR, " Vendor's account number
EKGRP TYPE EKKO-EKGRP, " Purchasing group
BEDAT TYPE EKKO-BEDAT, " Purchasing Document Date
WERKS TYPE LFA1-WERKS, " Plant
NAME1 TYPE LFA1-NAME1, " Name1
USERNAME TYPE CDHDR-USERNAME, " User name
UDATE TYPE CDHDR-UDATE, " Creation date of the change
" document
DDTEXT TYPE DD04T-DDTEXT, " Short Text Describing R/3
" Repository Objects
VALUE_NEW TYPE CDPOS-VALUE_NEW, " New contents of changed field
VALUE_OLD TYPE CDPOS-VALUE_OLD, " Old contents of changed field
END OF FS_OUTTAB,
Internal table to hold Purchase Document Number *
T_EBELN LIKE STANDARD TABLE
OF FS_EBELN,
Internal table to hold Purchase Document Header *
T_EKKO LIKE STANDARD TABLE
OF FS_EKKO,
Temp Internal table to hold Purchase Document Header *
T_EKKO_TEMP LIKE STANDARD TABLE
OF FS_EKKO,
Internal table to hold Account number and Name of the Vendor *
T_LFA1 LIKE STANDARD TABLE
OF FS_LFA1,
Internal Table to hold Change date and the name of the user *
T_CDHDR LIKE STANDARD TABLE
OF FS_CDHDR,
Internal Table to hold Change document items *
T_CDPOS LIKE STANDARD TABLE
OF FS_CDPOS,
Temp. Internal Table to hold Change document items *
T_CDPOS_TEMP LIKE STANDARD TABLE
OF FS_CDPOS,
Internal Table to hold Data Element Name *
T_DATAELE LIKE STANDARD TABLE
OF FS_DATAELE,
Temp. Internal Table to hold Data Element Name *
T_DATAELE_TEMP LIKE STANDARD TABLE
OF FS_DATAELE,
Internal Table to hold Short Text of the Date Element *
T_TEXT LIKE STANDARD TABLE
OF FS_TEXT,
Internal Table to hold data to be displayed on the ALV grid *
T_OUTTAB LIKE STANDARD TABLE
OF FS_OUTTAB.
C L A S S D E F I N I T I O N *
CLASS LCL_EVENT_HANDLER DEFINITION DEFERRED.
*" Data declarations...................................................
Work variables *
DATA:
W_EBELN TYPE EKKO-EBELN, " Purchasing Document Number
W_LIFNR TYPE EKKO-LIFNR, " Vendor's account number
W_EKGRP TYPE EKKO-EKGRP, " Purchasing group
W_VALUE TYPE EKKO-EBELN, " Reflected Value
W_SPACE VALUE ' ', " Space
W_FLAG TYPE I, " Flag Variable
W_VARIANT TYPE DISVARIANT, " Variant
*--- ALV Grid
W_GRID TYPE REF TO CL_GUI_ALV_GRID,
*--- Event Handler
W_EVENT_CLICK TYPE REF TO LCL_EVENT_HANDLER,
*--- Field catalog table
T_FIELDCAT TYPE LVC_T_FCAT.
AT SELECTION-SCREEN EVENT *
AT SELECTION-SCREEN ON S_EBELN.
Subroutine to validate Purchase Document Number.
PERFORM VALIDATE_PD_NUM.
AT SELECTION-SCREEN ON S_LIFNR.
Subroutine to validate Vendor Number.
PERFORM VALIDATE_VEN_NUM.
AT SELECTION-SCREEN ON S_EKGRP.
Subroutine to validate Purchase Group.
PERFORM VALIDATE_PUR_GRP.
START-OF-SELECTION EVENT *
START-OF-SELECTION.
Subroutine to select all Purchase orders.
PERFORM SELECT_PO.
CHECK W_FLAG EQ 0.
Subroutine to select Object values.
PERFORM SELECT_OBJ_ID.
CHECK W_FLAG EQ 0.
Subroutine to select Changed values.
PERFORM SELECT_CHANGED_VALUE.
CHECK W_FLAG EQ 0.
Subroutine to Select Purchase Orders.
PERFORM SELECT_PUR_DOC.
Subroutine to select Vendor Details.
PERFORM SELECT_VENDOR.
Subroutine to select Text for the Changed values.
PERFORM DESCRIPTION.
END-OF-SELECTION EVENT *
END-OF-SELECTION.
IF NOT T_EKKO IS INITIAL.
Subroutine to populate the Output Table.
PERFORM FILL_OUTTAB.
Subroutine to build Field Catalog.
PERFORM PREPARE_FIELD_CATALOG CHANGING T_FIELDCAT.
CALL SCREEN 100.
ENDIF. " IF NOT T_EKKO...
CLASS LCL_EVENT_HANDLER DEFINITION
Defining Class which handles events
CLASS LCL_EVENT_HANDLER DEFINITION .
PUBLIC SECTION .
METHODS:
HANDLE_HOTSPOT_CLICK
FOR EVENT HOTSPOT_CLICK OF CL_GUI_ALV_GRID
IMPORTING E_ROW_ID E_COLUMN_ID.
ENDCLASS. " LCL_EVENT_HANDLER DEFINITION
CLASS LCL_EVENT_HANDLER IMPLEMENTATION
Implementing the Class which can handle events
CLASS LCL_EVENT_HANDLER IMPLEMENTATION .
*---Handle Double Click
METHOD HANDLE_HOTSPOT_CLICK .
Subroutine to get the HotSpot Cell information.
PERFORM GET_CELL_INFO.
SET PARAMETER ID 'BES' FIELD W_VALUE.
CALL TRANSACTION 'ME23N'.
ENDMETHOD. " HANDLE_HOTSPOT_CLICK
ENDCLASS. " LCL_EVENT_HANDLER
*& Module STATUS_0100 OUTPUT
PBO Event
MODULE STATUS_0100 OUTPUT.
SET PF-STATUS 'OOPS'.
SET TITLEBAR 'TIT'.
Subroutine to fill the Variant Structure
PERFORM FILL_VARIANT.
IF W_GRID IS INITIAL.
CREATE OBJECT W_GRID
EXPORTING
I_SHELLSTYLE = 0
I_LIFETIME =
I_PARENT = CL_GUI_CONTAINER=>SCREEN0
I_APPL_EVENTS =
I_PARENTDBG =
I_APPLOGPARENT =
I_GRAPHICSPARENT =
I_NAME =
I_FCAT_COMPLETE = SPACE
EXCEPTIONS
ERROR_CNTL_CREATE = 1
ERROR_CNTL_INIT = 2
ERROR_CNTL_LINK = 3
ERROR_DP_CREATE = 4
OTHERS = 5.
IF SY-SUBRC <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF. " IF SY-SUBRC <> 0
CALL METHOD W_GRID->SET_TABLE_FOR_FIRST_DISPLAY
EXPORTING
I_BUFFER_ACTIVE =
I_BYPASSING_BUFFER =
I_CONSISTENCY_CHECK =
I_STRUCTURE_NAME =
IS_VARIANT = W_VARIANT
I_SAVE = 'A'
I_DEFAULT = 'X'
IS_LAYOUT =
IS_PRINT =
IT_SPECIAL_GROUPS =
IT_TOOLBAR_EXCLUDING =
IT_HYPERLINK =
IT_ALV_GRAPHICS =
IT_EXCEPT_QINFO =
IR_SALV_ADAPTER =
CHANGING
IT_OUTTAB = T_OUTTAB
IT_FIELDCATALOG = T_FIELDCAT
IT_SORT =
IT_FILTER =
EXCEPTIONS
INVALID_PARAMETER_COMBINATION = 1
PROGRAM_ERROR = 2
TOO_MANY_LINES = 3
OTHERS = 4
IF SY-SUBRC <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF. " IF SY-SUBRC <> 0.
ENDIF. " IF W_GRID IS INITIAL
CREATE OBJECT W_EVENT_CLICK.
SET HANDLER W_EVENT_CLICK->HANDLE_HOTSPOT_CLICK FOR W_GRID.
ENDMODULE. " STATUS_0100 OUTPUT
*& Module USER_COMMAND_0100 INPUT
PAI Event
MODULE USER_COMMAND_0100 INPUT.
CASE SY-UCOMM.
WHEN 'BACK'.
LEAVE TO SCREEN 0.
WHEN 'EXIT'.
LEAVE PROGRAM.
WHEN 'CANCEL'.
LEAVE TO SCREEN 0.
ENDCASE.
ENDMODULE. " USER_COMMAND_0100 INPUT
*& Form PREPARE_FIELD_CATALOG
Subroutine to build the Field catalog
<--P_T_FIELDCAT Field Catalog Table
FORM PREPARE_FIELD_CATALOG CHANGING PT_FIELDCAT TYPE LVC_T_FCAT .
DATA LS_FCAT TYPE LVC_S_FCAT.
Purchasing group...
LS_FCAT-FIELDNAME = 'EKGRP'.
LS_FCAT-REF_TABLE = 'EKKO'.
LS_FCAT-INTTYPE = 'C'.
LS_FCAT-OUTPUTLEN = '10'.
APPEND LS_FCAT TO PT_FIELDCAT.
CLEAR LS_FCAT.
Purchasing Document Number...
LS_FCAT-FIELDNAME = 'EBELN'.
LS_FCAT-REF_TABLE = 'EKKO' .
LS_FCAT-EMPHASIZE = 'C411'.
LS_FCAT-INTTYPE = 'C'.
LS_FCAT-OUTPUTLEN = '10'.
LS_FCAT-HOTSPOT = 'X'.
APPEND LS_FCAT TO PT_FIELDCAT .
CLEAR LS_FCAT .
Name of Person who Created the Object...
LS_FCAT-FIELDNAME = 'ERNAM'.
LS_FCAT-REF_TABLE = 'EKKO'.
LS_FCAT-OUTPUTLEN = '15' .
APPEND LS_FCAT TO PT_FIELDCAT.
CLEAR LS_FCAT.
Purchasing Document Date...
LS_FCAT-FIELDNAME = 'BEDAT'.
LS_FCAT-REF_TABLE = 'EKKO'.
LS_FCAT-INTTYPE = 'C'.
LS_FCAT-OUTPUTLEN = '10'.
APPEND LS_FCAT TO PT_FIELDCAT.
CLEAR LS_FCAT.
Vendor's account number...
LS_FCAT-FIELDNAME = 'LIFNR'.
LS_FCAT-REF_TABLE = 'EKKO'.
LS_FCAT-INTTYPE = 'C'.
LS_FCAT-OUTPUTLEN = '10'.
APPEND LS_FCAT TO PT_FIELDCAT.
CLEAR LS_FCAT.
Account Number of Vendor or Creditor...
LS_FCAT-FIELDNAME = 'NAME1'.
LS_FCAT-REF_TABLE = 'LFA1'.
LS_FCAT-INTTYPE = 'C'.
LS_FCAT-OUTPUTLEN = '10'.
LS_FCAT-COLTEXT = 'Vendor Name'(001).
LS_FCAT-SELTEXT = 'Vendor Name'(001).
APPEND LS_FCAT TO PT_FIELDCAT.
CLEAR LS_FCAT.
Creation date of the change document...
LS_FCAT-FIELDNAME = 'UDATE'.
LS_FCAT-REF_TABLE = 'CDHDR'.
LS_FCAT-INTTYPE = 'C'.
LS_FCAT-OUTPUTLEN = '10'.
LS_FCAT-COLTEXT = 'Change Date'(002).
LS_FCAT-SELTEXT = 'Change Date'(002).
APPEND LS_FCAT TO PT_FIELDCAT.
CLEAR LS_FCAT.
User name of the person responsible in change document...
LS_FCAT-FIELDNAME = 'USERNAME'.
LS_FCAT-REF_TABLE = 'CDHDR'.
LS_FCAT-INTTYPE = 'C'.
LS_FCAT-OUTPUTLEN = '10'.
LS_FCAT-COLTEXT = 'Modified by'(003).
LS_FCAT-SELTEXT = 'Modified by'(003).
APPEND LS_FCAT TO PT_FIELDCAT.
CLEAR LS_FCAT.
Short Text Describing R/3 Repository Objects...
LS_FCAT-FIELDNAME = 'DDTEXT'.
LS_FCAT-REF_TABLE = 'DD04T'.
LS_FCAT-INTTYPE = 'C'.
LS_FCAT-OUTPUTLEN = '15'.
APPEND LS_FCAT TO PT_FIELDCAT.
CLEAR LS_FCAT.
Old contents of changed field...
LS_FCAT-FIELDNAME = 'VALUE_OLD'.
LS_FCAT-REF_TABLE = 'CDPOS'.
LS_FCAT-INTTYPE = 'C'.
LS_FCAT-OUTPUTLEN = '12'.
APPEND LS_FCAT TO PT_FIELDCAT.
CLEAR LS_FCAT.
New contents of changed field...
LS_FCAT-FIELDNAME = 'VALUE_NEW'.
LS_FCAT-REF_TABLE = 'CDPOS'.
LS_FCAT-INTTYPE = 'C'.
LS_FCAT-OUTPUTLEN = '12'.
APPEND LS_FCAT TO PT_FIELDCAT.
CLEAR LS_FCAT.
ENDFORM. " PREPARE_FIELD_CATALOG
*& Form SELECT_PO
Subroutine to select all the Purchase Orders
There are no interface parameters to be passed to this subroutine.
FORM SELECT_PO .
SELECT EBELN " Purchasing Document Number
ERNAM " Name of Person who Created
" the Object
LIFNR " Vendor's account number
EKGRP " Purchasing group
BEDAT " Purchasing Document Date
FROM EKKO
PACKAGE SIZE 10000
APPENDING TABLE T_EBELN
WHERE EBELN IN S_EBELN
AND BEDAT IN S_BEDAT.
ENDSELECT.
IF SY-SUBRC NE 0.
W_FLAG = 1.
MESSAGE S401(M8).
ENDIF. " IF SY-SUBRC NE 0
ENDFORM. " SELECT_PO
*& Form SELECT_OBJ_ID
Subroutine to select Object ID
There are no interface parameters to be passed to this subroutine.
FORM SELECT_OBJ_ID .
IF NOT T_EBELN IS INITIAL.
SELECT OBJECTCLAS " Object Class
OBJECTID " Object value
CHANGENR " Document change number
USERNAME " User name
UDATE " Creation date
FROM CDHDR
INTO TABLE T_CDHDR
FOR ALL ENTRIES IN T_EBELN
WHERE OBJECTID EQ T_EBELN-EBELN
AND UDATE IN S_UDATE
AND TCODE IN ('ME21N','ME22N','ME23N').
ENDSELECT.
IF SY-SUBRC NE 0.
W_FLAG = 1.
MESSAGE S833(M8) WITH 'Header Not Found'(031).
ENDIF. " IF SY-SUBRC NE 0.
ENDIF. " IF NOT T_EBELN IS INITIAL
ENDFORM. " SELECT_OBJ_ID
*& Form SELECT_CHANGED_VALUE
Subroutine to select Changed Values
There are no interface parameters to be passed to this subroutine.
FORM SELECT_CHANGED_VALUE .
IF NOT T_CDHDR IS INITIAL.
SELECT OBJECTCLAS " Object class
OBJECTID " Object value
CHANGENR " Document change number
TABNAME " Table Name
FNAME " Field Name
VALUE_NEW " New contents of changed field
VALUE_OLD " Old contents of changed field
FROM CDPOS
PACKAGE SIZE 10000
APPENDING TABLE T_CDPOS
FOR ALL ENTRIES IN T_CDHDR
WHERE OBJECTCLAS EQ T_CDHDR-OBJECTCLAS
AND OBJECTID EQ T_CDHDR-OBJECTID
AND CHANGENR EQ T_CDHDR-CHANGENR.
ENDSELECT.
IF SY-SUBRC NE 0.
W_FLAG = 1.
MESSAGE S833(M8) WITH 'Item Not Found'(032).
ENDIF. " IF SY-SUBRC NE 0.
ENDIF. " IF NOT T_CDHDR IS INITIAL
T_CDPOS_TEMP[] = T_CDPOS[].
ENDFORM. " SELECT_CHANGED_VALUE
*& Form SELECT_PUR_DOC
Subroutine to select Purchase Order Details
There are no interface parameters to be passed to this subroutine.
FORM SELECT_PUR_DOC .
IF NOT T_CDPOS IS INITIAL.
SORT T_EBELN BY EBELN.
LOOP AT T_CDPOS INTO FS_CDPOS.
READ TABLE T_EBELN INTO FS_EBELN WITH KEY EBELN =
FS_CDPOS-OBJECTID BINARY SEARCH.
IF SY-SUBRC NE 0.
DELETE TABLE T_EBELN FROM FS_EBELN.
ENDIF. " IF SY-SUBRC NE 0.
ENDLOOP. " LOOP AT T_CDPOS...
LOOP AT T_EBELN INTO FS_EBELN.
MOVE FS_EBELN-EBELN TO FS_EKKO-EBELN.
MOVE FS_EBELN-ERNAM TO FS_EKKO-ERNAM.
MOVE FS_EBELN-LIFNR TO FS_EKKO-LIFNR.
MOVE FS_EBELN-EKGRP TO FS_EKKO-EKGRP.
MOVE FS_EBELN-BEDAT TO FS_EKKO-BEDAT.
APPEND FS_EKKO TO T_EKKO.
ENDLOOP. " LOOP AT T_EBELN...
T_EKKO_TEMP[] = T_EKKO[].
ENDIF. " IF NOT T_CDPOS IS INITIAL
ENDFORM. " SELECT_PUR_DOC
*& Form SELECT_VENDOR
Subroutine to select Vendor details
There are no interface parameters to be passed to this subroutine.
FORM SELECT_VENDOR .
IF NOT T_EKKO IS INITIAL.
SORT T_EKKO_TEMP BY LIFNR.
DELETE ADJACENT DUPLICATES FROM T_EKKO_TEMP COMPARING LIFNR.
SELECT LIFNR " Account Number of Vendor or
" Creditor
NAME1 " Name 1
FROM LFA1
INTO TABLE T_LFA1
FOR ALL ENTRIES IN T_EKKO_TEMP
WHERE LIFNR EQ T_EKKO_TEMP-LIFNR.
IF SY-SUBRC NE 0.
MESSAGE S002(M8) WITH 'Master Details'(033).
ENDIF. " IF SY-SUBRC NE 0.
ENDIF. " IF NOT T_EKKO IS INITIAL
ENDFORM. " SELECT_VENDOR
*& Form DESCRIPTION
Subroutine to get the description
There are no interface parameters to be passed to this subroutine.
FORM DESCRIPTION .
IF NOT T_CDPOS IS INITIAL.
SORT T_CDPOS_TEMP BY TABNAME FNAME.
DELETE ADJACENT DUPLICATES FROM T_CDPOS_TEMP COMPARING TABNAME FNAME
SELECT TABNAME " Table Name
FIELDNAME " Field Name
ROLLNAME " Data element
FROM DD03L
INTO TABLE T_DATAELE
FOR ALL ENTRIES IN T_CDPOS_TEMP
WHERE TABNAME EQ T_CDPOS_TEMP-TABNAME
AND FIELDNAME EQ T_CDPOS_TEMP-FNAME.
IF NOT T_DATAELE IS INITIAL.
T_DATAELE_TEMP[] = T_DATAELE[].
SORT T_DATAELE_TEMP BY ROLLNAME.
DELETE ADJACENT DUPLICATES FROM T_DATAELE_TEMP COMPARING ROLLNAME.
SELECT ROLLNAME " Data element
DDTEXT " Short Text Describing R/3
" Repository Objects
FROM DD04T
INTO TABLE T_TEXT
FOR ALL ENTRIES IN T_DATAELE_TEMP
WHERE ROLLNAME EQ T_DATAELE_TEMP-ROLLNAME
AND DDLANGUAGE EQ SY-LANGU.
IF SY-SUBRC NE 0.
EXIT.
ENDIF. " IF SY-SUBRC NE 0.
ENDIF. " IF NOT T_DATAELE IS INITIAL.
ENDIF. " IF NOT T_CDPOS IS INITIAL.
ENDFORM. " DESCRIPTION
*& Form FILL_OUTTAB
Subroutine to populate the Outtab
There are no interface parameters to be passed to this subroutine.
FORM FILL_OUTTAB .
SORT T_CDHDR BY OBJECTCLAS OBJECTID CHANGENR.
SORT T_EKKO BY EBELN.
SORT T_LFA1 BY LIFNR.
SORT T_DATAELE BY TABNAME FIELDNAME.
SORT T_TEXT BY ROLLNAME.
LOOP AT T_CDPOS INTO FS_CDPOS.
READ TABLE T_CDHDR INTO FS_CDHDR WITH KEY
OBJECTCLAS = FS_CDPOS-OBJECTCLAS
OBJECTID = FS_CDPOS-OBJECTID
CHANGENR = FS_CDPOS-CHANGENR
BINARY SEARCH.
IF SY-SUBRC EQ 0.
MOVE FS_CDHDR-USERNAME TO FS_OUTTAB-USERNAME.
MOVE FS_CDHDR-UDATE TO FS_OUTTAB-UDATE.
READ TABLE T_EKKO INTO FS_EKKO WITH KEY
EBELN = FS_CDHDR-OBJECTID
BINARY SEARCH.
IF SY-SUBRC EQ 0.
MOVE FS_EKKO-EBELN TO FS_OUTTAB-EBELN.
MOVE FS_EKKO-ERNAM TO FS_OUTTAB-ERNAM.
MOVE FS_EKKO-LIFNR TO FS_OUTTAB-LIFNR.
MOVE FS_EKKO-EKGRP TO FS_OUTTAB-EKGRP.
MOVE FS_EKKO-BEDAT TO FS_OUTTAB-BEDAT.
READ TABLE T_LFA1 INTO FS_LFA1 WITH KEY
LIFNR = FS_EKKO-LIFNR
BINARY SEARCH.
IF SY-SUBRC EQ 0.
MOVE FS_LFA1-NAME1 TO FS_OUTTAB-NAME1.
ENDIF. " IF SY-SUBRC EQ 0.
ENDIF. " IF SY-SUBRC EQ 0.
ENDIF. " IF SY-SUBRC EQ 0.
MOVE FS_CDPOS-VALUE_NEW TO FS_OUTTAB-VALUE_NEW.
MOVE FS_CDPOS-VALUE_OLD TO FS_OUTTAB-VALUE_OLD.
READ TABLE T_DATAELE INTO FS_DATAELE WITH KEY
TABNAME = FS_CDPOS-TABNAME
FIELDNAME = FS_CDPOS-FNAME
BINARY SEARCH.
IF SY-SUBRC EQ 0.
READ TABLE T_TEXT INTO FS_TEXT WITH KEY
ROLLNAME = FS_DATAELE-ROLLNAME
BINARY SEARCH.
IF SY-SUBRC EQ 0.
MOVE FS_TEXT-DDTEXT TO FS_OUTTAB-DDTEXT.
ENDIF. " IF SY-SUBRC EQ 0.
ENDIF. " IF SY-SUBRC EQ 0.
APPEND FS_OUTTAB TO T_OUTTAB.
CLEAR FS_OUTTAB.
ENDLOOP.
ENDFORM. " FILL_OUTTAB
*& Form GET_CELL_INFO
Subroutine to get the Cell Information
--> W_VALUE Holds the value of Hotspot clicked
FORM GET_CELL_INFO .
CALL METHOD W_GRID->GET_CURRENT_CELL
IMPORTING
E_ROW =
E_VALUE = W_VALUE
E_COL =
ES_ROW_ID =
ES_COL_ID =
ES_ROW_NO =
ENDFORM. " GET_CELL_INFO
*& Form VALIDATE_PD_NUM
Subroutine to validate Purchase Document Number
There are no interface parameters to be passed to this subroutine.
FORM VALIDATE_PD_NUM .
IF NOT S_EBELN[] IS INITIAL.
SELECT EBELN " Purchase Document Number
FROM EKKO
INTO W_EBELN
UP TO 1 ROWS
WHERE EBELN IN S_EBELN.
ENDSELECT.
IF SY-SUBRC NE 0.
CLEAR SSCRFIELDS-UCOMM.
MESSAGE E717(M8).
ENDIF. " IF SY-SUBRC NE 0
ENDIF. " IF NOT S_EBELN[]...
ENDFORM. " VALIDATE_PD_NUM
*& Form VALIDATE_VEN_NUM
Subroutine to validate Vendor Number
There are no interface parameters to be passed to this subroutine.
FORM VALIDATE_VEN_NUM .
IF NOT S_LIFNR[] IS INITIAL.
SELECT LIFNR " Vendor Number
FROM LFA1
INTO W_LIFNR
UP TO 1 ROWS
WHERE LIFNR IN S_LIFNR.
ENDSELECT.
IF SY-SUBRC NE 0.
CLEAR SSCRFIELDS-UCOMM.
MESSAGE E002(M8) WITH W_SPACE.
ENDIF. " IF SY-SUBRC NE 0
ENDIF. " IF NOT S_LIFNR[]...
ENDFORM. " VALIDATE_VEN_NUM
*& Form VALIDATE_PUR_GRP
Subroutine to validate the Purchase Group
There are no interface parameters to be passed to this subroutine.
FORM VALIDATE_PUR_GRP .
IF NOT S_EKGRP[] IS INITIAL.
SELECT EKGRP " Purchase Group
FROM T024
INTO W_EKGRP
UP TO 1 ROWS
WHERE EKGRP IN S_EKGRP.
ENDSELECT.
IF SY-SUBRC NE 0.
CLEAR SSCRFIELDS-UCOMM.
MESSAGE E622(M8) WITH W_SPACE.
ENDIF. " IF SY-SUBRC NE 0
ENDIF. " IF NOT S_EKFRP[]...
ENDFORM. " VALIDATE_PUR_GRP
*& Form FILL_VARIANT
Subroutine to fill the Variant Structure
There are no interface parameters to be passed to this subroutine
FORM FILL_VARIANT .
Filling the Variant structure
W_VARIANT-REPORT = SY-REPID.
W_VARIANT-USERNAME = SY-UNAME.
ENDFORM. " FILL_VARIANT
<b>Reward if usefull</b> -
Urgent!!! 1099 vendor reporting issues.
Hi SAP Gurus,
I have few issues on 1099 reporting I wonder if anyone could help address these below issues.
1. I did all the configuration for 1099 reporting on vendor master and I am running RFW1099M and RFIDYYWT programs to see the cleared vendor line items but I can see only few vendors cleared line items and the other vendors items are not getting displayed. I double checked the vendor master the settings are exactly the same except WH tax codes.
2. The 1099 Minimum amounts on the RFW1099M program doesn't seem to work coz it displays all the items which are less than the 1099 Minimum amounts mentioned in the selection screen for example it was mentioned $600 on selection screen of the Minimum amounts field now it displays items which are less than $600.
3. There are 9 specific Return types (Business specific) along with WH Tax codes and the combination of both leads to 1099 minimum amounts. How to achieve this requirement? for example see below.
Return,Type WH Tax code Description 1099 Minimum
1 1 Gross Dividends on Stock 10
1 7 Cash liquidation distributions 600
3 6 Mortgage interest received 600
6 1 Earnings from S&L, cr unions 10
Kind Regards,
BobHi Bob,
I am not sure whether its a Basis question. However, I found a similar forum with same issue. Please refer to below link
Report 1099 program(RFW1099M) issue
1099 report- program RFTW0010/RFTW0020
1099 vendors, S_PL0_09000314 - 1099-Misc
Regards,
Arjun -
1099 vendors, S_PL0_09000314 - 1099-Misc
Hi,
I have an issue while running the S_PL0_09000314 - 1099-Misc report. I created a test 1099 vendor, by maintaining (1) tax number under tax information and (2) Witholding tax code 07 for the vendor. With these settings, I posted an invoice and paid the vendor.
The issue is while running the report S_PL0_09000314 - 1099-Misc, it says "list contains no data" (under vendors with correct TIN). However, in the same report, I was able to see the vendor listed under Wrong TIN:Vendors.
Also, when I ran the 1099 listings (S_ALR_87012143 - 1099 Listings), it showed the vendor with the list of documents posted/cleared.
What could be the problem that S_PL0_09000314 - 1099-Misc is not showing the vendor under under vendors with correct TIN. Am I missing something here?
Any help is hightly appreciated.
Thanks,
RamHi Dominic,
I would appreciate if you could help me on the following
When I run S_P00_07000134 - Generic Withholding Tax Reporting to generate the 1099 output I get the following errors
1. Company code 3000's witholding tax reference number is missing
2. Unable to print form IDWTCERT_US_1099MISC
I chose the following in the program
Process group: US_1099
Output group: US1
Am I missing any configuration or something else here?
Would appreciate any kind of help.
Thanks -
Data Medium Exchange of Travel Expenses for Finland
Hi, On sap menu search "Accounting-> Financial Accounting-> Travel Management-> Travel Expenses-> Periodic Processing-> Payment via Data Medium Exchange (DME)-> Change Country Grouping"
when i try change to country finland, the following error appear :"For coutry version 44 no payment program is implemented". I need to know if exist a program for data medium exchange to Finland?
Thanks,
SoniaYou can go to SE80 -> "Choose" package - PC44 where <b>44</b>is for Finland. You`ll get programs.
see also Package = FBZ
RFEBFI00 Bank Statement: Finland Reference Payments -
RFEBFI20 Account Statement for Finland in TITO Format
RFEBFILUM00 Bank Statement Finland - Conversion to Multic
RFFOFI_A Payment Medium (Finland) - Domestic Customers
RFFOFI_L Data Medium Finland - Domestic Vendor Transac
RFFOFI_U Payment Medium for Finland - Vendor Transacti
Hope thisll give you idea!!
<b>P.S award the points.</b>
Good luck
Thanks
Saquib Khan
"Some are wise and some are otherwise"
Maybe you are looking for
-
Hi All, I have a master block and the respective detail block is on a different canvas and I invoke it using 'Show' button in the Master Block. In the Detail/Child block I can able to display all the respective records(5 records display). Now I need
-
I have 4 movies in iDVD. How do I give loop in all film?
-
Clamshell mode not working, tried every possible way
Grr, this is getting so frustrating. I have tried every possible method, even following apple's guides. None of them work for me. I even tried the "boot" method the guy told me about in the last thread, and that still didn't work!!! I have both my bl
-
Is it hard to add a link to a web page within a Java text scroller? Can I do it within a parameter tag (I would doubt that but I'm hoping) or does it have to be within the java source? Thank you!
-
ALE and IDocs Relevant Issues (Error Code 51)
Dear Gurus, I created a Master Data (MD)u2018testmrtu2019 via MM01 in our DEV environment. Now I want to transfer it into QAS environment via ALE mode. (The ALE configuration work was done.) The MD was successfully sent from DEV via BD10. (The light