Powered By

Free XML Skins for Blogger

Powered by Blogger

Showing posts with label SAP SD ABAP Reports. Show all posts
Showing posts with label SAP SD ABAP Reports. Show all posts

Monday, November 9, 2009

Settlement Downpayment with Installment payment Term

Scenario :- Problem with Down payment settlement using installment payment term.

1. When we create Sales order, (sales item value = 100) use payment term :
0009 (Installment Payment term, 30%, 40%, 30%). In the Billing Plan, I specify 2 records, 1st record is
Downpayment request 30% of Order value, billing type is FAZ . the 2nd record is Final invoice 100%, billing
type is F2.

2. Create Billing type Down payment request , it will document as Noted item in the accounting document.

3. Receive Downpayment from customer via FI screen , at this stage the asccounting document is created as following
Dr. Cash/Bank 30
Cr. Advance from customer 30

4. When I create Billing document for the sales item, the down payment value will be proposed for settlement at Billing
Creation, I then accept the default value of down payment clearing. The accounting document is as below
Dr. AR 30 (*split AR by installment payment term)
AR 40
AR 30
Cr. Sales 100
Dr. Advance from customer 30
Cr. AR 9 (DP. 30% * 30)
Cr AR 12 (DP. 30% * 40)
Cr AR 9 (DP. 30% * 30)

It seems SAP settlement Down payment by Installment Payment term. I was wondering that is there are alternative or an option to setup the Down payment settlement independent of Installment term. I meant, I don't want to have the last 3 Credit item as above, I want only 1 line item of credit, the accounting should be
Dr. AR 30 (*split AR by installment payment term)
AR 40
AR 30
Cr. Sales 100
Dr. Advance from customer 30
Cr. AR 30 (Not separate by Installment payment term)

Solutions : Suggesstions on how I could proceed?

Your problem with Down payment settlement is common. Many users object to the down payment or security lodgement mechanism. In our case we often park and apply the advance manually to final invoice.

However, following the above case we sometimes use this with our PS orders:

1. Create Sales order, (sales item value = 100) with billing plan with three steps 30% down payment,30% std billiing on
order completion and 70% on delivery. A little different to your original Billing Plan, but 1st record is Downpayment
request 30% of Order value, billing type is FAZ . the 2nd & 3rd records are std F2 invoices 30% ,70%.

2. Create Billing type Down payment request , it will document as Noted item in the accounting document.

3. Receive Downpayment from customer via FI screen , at this stage the accounting document is created as following :-
Dr. Cash/Bank 30
Cr. Security deposit payment 30 ( In many countries this may be subject to TAX laws)

4. Create the First Billing documents , the down payment value will be proposed for settlement at Billing Creation, then
accept the default value of down payment clearing as these equal each other. The accounting document is as below
Dr. AR 30
Cr. Sales 30
Dr. Advance from customer 30
Cr. AR 30

5. Create the Second Billing document ( down payment value has expired and will not be proposed) The accounting
document is as below is then standard for the last installement.
Dr. AR 60
Cr. Sales 60

This alternative provides a cleaner option with the Downpayment.

SD What r the 5 imp fields to be maintained in a/c determination

Account Determination: Sales View, Sales Organization, Distribution Channel, Chart of Accounts, Account Assignment Group for Customer and Material and Account Keys.

Special Processing Indicator

The Special Processing Indicator defines the mode of shipment to be used for an order and applies the corresponding shipping costs based on the mode used. Express shipping or special tariffs are forms of special processing.

Following is the process of defining “Special Processing Indicator”:

Go to transaction SPRO -> Logistics Execution -> Transportation -> Define Special Processing Indicator

Following screen appears:

Click on New entries.

Add a Special Processing Indicator.

Save your entries.

All entries regarding the “Special Processing Indicator” are stored in the table TVSAK and the texts for the same are stored in the table TVSAKT.

Following is the procedure to set the “Special Processing Indicator” in the Sales Order:

Open any of the available Sales Order (Transaction VA02):

Click on “Display doc. Header details” (highlighted above):

Click on the tab “Shipping”

Enter the value in the field “Special Processing Indicator”:

This value is stored in the field SDABW of VBAK table.

Sales and Distribution - Upload Condition Pricing

RV14BTCI - Batch Input for Uploading Condition Pricing

After executing the program, you have to use SM35 to process the update program.

Envirionment : 4.6x

Require flat file :-

ROW 1 BGR00
ROW 2 BKOND1
ROW 3 BKOND2 - no scale
ROW 4 BKOND2 - no scale
ROW 5 BKOND3 - with scale
ROW 6 BKOND2 - no scale

Sample flat file for uploading table A305 - Customer/Material with release status :-

0BIPRICE 123SAPABAP X
1VK15 A305V PR00
2ALL 990000123456SAP8204142100 2002043020020401 50USD 100PC
2ALL 990000123456SAP8217168100 2002043020020401 50USD 100PC
3 100PC 2
3 200PC 1
2ALL 990000123456SAP8220133910

There a total of 4 flat file format :-
BGR00 - Session Header Record



------------------------------------------------------------------------------------------

| Field name | Description | Report header | Cat. | Length | Dec. |

------------------------------------------------------------------------------------------

| STYPE | Record type | 0 | CHAR | 000001 | 000000 |

| GROUP | Group name | BI Session Name | CHAR | 000012 | 000000 |

| MANDT | Client | Your client no | CLNT | 000003 | 000000 |

| USNAM | User ID | Queue user ID | CHAR | 000012 | 000000 |

| START | Lock until: | Queue start date | DATS | 000010 | 000000 |

| XKEEP | Keep indicator | X - don't delete SESS| CHAR | 000001 | 000000 |

| NODATA | No batch input | / | CHAR | 000001 | 000000 |

------------------------------------------------------------------------------------------



BKOND1 - Header Record



------------------------------------------------------------------------------------------

| Field name | Description | Report header | Cat. | Length | Dec. |

------------------------------------------------------------------------------------------

| STYPE | Record type | 1 | CHAR | 000001 | 000000 |

| TCODE | Transaction code | TCode = VK15 | CHAR | 000020 | 000000 |

| KVEWE | Usage | U | CHAR | 000001 | 000000 |

| KOTABNR | Table | Table e.g. 305 | CHAR | 000003 | 000000 |

| KAPPL | Application | App e.g V | CHAR | 000002 | 000000 |

| KSCHL | Condition type | CTyp e.g PR00 | CHAR | 000004 | 000000 |

------------------------------------------------------------------------------------------



BKOND2 - Main Data Record



------------------------------------------------------------------------------------------





| Field name | Description | Report header | Cat. | Length | Dec. |

------------------------------------------------------------------------------------------

| STYPE | Record type | 2 | CHAR | 000001 | 000000 |

| VAKEY | VarKey | VarKey | CHAR | 000100 | 000000 |

| DATBI | Valid to | Valid to | DATS | 000010 | 000000 |

| DATAB | Valid on | Valid on | DATS | 000010 | 000000 |

| KBETR | Amount | Amount | CHAR | 000015 | 000000 |

| KONWA | R/2 table | R2tab | CHAR | 000005 | 000000 |

| KPEIN | R/2 table | R2tab | CHAR | 000005 | 000000 |

| KMEIN | | | CHAR | 000003 | 000000 |

| MWSK1 | Tax code | Tx | CHAR | 000002 | 000000 |

| KONMS | Scale UoM | UoM | UNIT | 000003 | 000000 |

| MXWRT | Amount | Amount | CHAR | 000015 | 000000 |

| GKWRT | Amount | Amount | CHAR | 000015 | 000000 |

| STFKZ | Scale type | S | CHAR | 000001 | 000000 |

| KZNEP | Exclusion | CndEx | CHAR | 000001 | 000000 |

| LOEVM_KO | Deletion indic. | D | CHAR | 000001 | 000000 |

| SKONWA | R/2 table | R2tab | CHAR | 000005 | 000000 |

------------------------------------------------------------------------------------------



BKOND3 - Scale Data Record



------------------------------------------------------------------------------------------

| Field name | Description | Report header | Cat. | Length | Dec. |

------------------------------------------------------------------------------------------

| STYPE | Record type | 3 | CHAR | 000001 | 000000 |

| KSTBM | Quantity | Quantity | CHAR | 000018 | 000000 |

| KONMS | Scale UoM | UoM | UNIT | 000003 | 000000 |

| KBETR | Amount | Amount | CHAR | 000015 | 000000 |

-------------------------------------------------------------------------------------

Sales Order Changed History Display

*
* Sales Order Changed History Display
*
* You can execute the report by :
* 1. Change Date
* 2. User Name
* 3. Sales Order Number
*
* Submitted by : SAP Basis, ABAP Programming and Other IMG Stuff
*
*
REPORT ZSDCHANGE LINE-SIZE 132 NO STANDARD PAGE HEADING
LINE-COUNT 065(001)
MESSAGE-ID VR.

TABLES: DD04T,
CDHDR,
CDPOS,
DD03L,
DD41V,
T685T,
VBPA,
TPART,
KONVC,
VBUK.

DATA: BEGIN OF ICDHDR OCCURS 50.
INCLUDE STRUCTURE CDHDR.
DATA: END OF ICDHDR.

SELECT-OPTIONS: XUDATE FOR ICDHDR-UDATE,
XNAME FOR ICDHDR-USERNAME,
XVBELN FOR VBUK-VBELN.

SELECTION-SCREEN SKIP.
SELECTION-SCREEN BEGIN OF BLOCK BLK1 WITH FRAME TITLE TEXT-001.
PARAMETERS: SUDATE RADIOBUTTON GROUP R1,
SNAME RADIOBUTTON GROUP R1,
SOBID RADIOBUTTON GROUP R1.
SELECTION-SCREEN END OF BLOCK BLK1.

DATA: WFLAG,
WCHANGENR LIKE CDHDR-CHANGENR,
WUDATE LIKE CDHDR-UDATE,
WNAME LIKE CDHDR-USERNAME,
WVBELN LIKE VBUK-VBELN,
WDEC1 TYPE P DECIMALS 3,
WDEC2 TYPE P DECIMALS 3,
WDEC3 TYPE P DECIMALS 3,
WDEC4 TYPE P DECIMALS 3.

DATA: UTEXT(16) VALUE 'has been changed',
ITEXT(16) VALUE 'has been created',
DTEXT(16) VALUE 'has been deleted'.

DATA: BEGIN OF ICDSHW OCCURS 50.
INCLUDE STRUCTURE CDSHW.
DATA: END OF ICDSHW.

DATA: BEGIN OF ITAB OCCURS 10.
INCLUDE STRUCTURE CDSHW.
DATA: UDATE LIKE CDHDR-UDATE,
USERNAME LIKE CDHDR-USERNAME,
CHANGENR LIKE CDHDR-CHANGENR,
VBELN(10),
POSNR(6),
ETENR(4),
INDTEXT(200),
END OF ITAB.

SELECT * FROM VBUK WHERE VBELN IN XVBELN.
CLEAR CDHDR.
CLEAR CDPOS.
CDHDR-OBJECTCLAS = 'VERKBELEG'.
CDHDR-OBJECTID = VBUK-VBELN.
PERFORM READHEADER.
PERFORM READPOS.
LOOP AT ITAB.
CASE ITAB-TABNAME.
WHEN 'VBPA'.
IF ITAB-FNAME = 'KUNNR' OR
ITAB-FNAME = 'LIFNR' OR
ITAB-FNAME = 'PARNR' OR
ITAB-FNAME = 'PERNR' OR
ITAB-FNAME IS INITIAL.
MOVE ITAB-TABKEY TO VBPA.
SELECT SINGLE * FROM TPART WHERE SPRAS = SY-LANGU
AND PARVW = VBPA-PARVW.
IF SY-SUBRC = 0.
REPLACE '&' WITH TPART-VTEXT INTO ITAB-INDTEXT.
ENDIF.
ENDIF.
WHEN 'VBAP'.
IF ITAB-FNAME IS INITIAL.
REPLACE '&' WITH 'Item' INTO ITAB-INDTEXT.
ENDIF.
WHEN 'KONVC'.
MOVE ITAB-TABKEY TO KONVC.
SELECT SINGLE * FROM T685T WHERE SPRAS = SY-LANGU
AND KVEWE = 'A'
AND KAPPL = 'V'
AND KSCHL = KONVC-KSCHL.
IF SY-SUBRC = 0.
REPLACE '&' WITH T685T-VTEXT INTO ITAB-INDTEXT.
ENDIF.
ENDCASE.
IF ITAB-INDTEXT(1) EQ '&'.
REPLACE '&' WITH ITAB-FTEXT(40) INTO ITAB-INDTEXT.
ENDIF.
IF ITAB-CHNGIND = 'I'.
REPLACE '%' WITH ITEXT INTO ITAB-INDTEXT.
ELSEIF ITAB-CHNGIND = 'U'.
REPLACE '%' WITH UTEXT INTO ITAB-INDTEXT.
ELSE.
REPLACE '%' WITH DTEXT INTO ITAB-INDTEXT.
ENDIF.
CONDENSE ITAB-INDTEXT.
MODIFY ITAB.
ENDLOOP.
ENDSELECT.

IF SUDATE = 'X'.
SORT ITAB BY UDATE VBELN POSNR ETENR.
ELSEIF SOBID = 'X'.
SORT ITAB BY VBELN POSNR ETENR UDATE.
ELSE.
SORT ITAB BY USERNAME VBELN POSNR ETENR UDATE.
ENDIF.

LOOP AT ITAB.
CLEAR WFLAG.
IF SUDATE = 'X'.
IF WUDATE NE ITAB-UDATE.
SKIP.
WRITE:/001 ITAB-UDATE,
023 ITAB-USERNAME,
037(10) ITAB-VBELN.
WFLAG = 'X'.
WUDATE = ITAB-UDATE.
WCHANGENR = ITAB-CHANGENR.
ENDIF.
ELSEIF SOBID NE 'X'.
IF WVBELN NE ITAB-VBELN.
SKIP.
WRITE:/001 ITAB-VBELN.
WVBELN = ITAB-VBELN.
ENDIF.
ELSE.
IF WNAME NE ITAB-USERNAME.
SKIP.
WRITE:/001 ITAB-USERNAME.
WNAME = ITAB-USERNAME.
ENDIF.
ENDIF.
IF WCHANGENR NE ITAB-CHANGENR.
WRITE:/023 ITAB-USERNAME,
037(10) ITAB-VBELN.
WFLAG = 'X'.
WCHANGENR = ITAB-CHANGENR.
ENDIF.
IF WFLAG = 'X'.
WRITE: 013 ITAB-CHNGIND,
049 ITAB-POSNR,
057 ITAB-ETENR,
065 ITAB-INDTEXT(60).
ELSE.
WRITE: /013 ITAB-CHNGIND,
049 ITAB-POSNR,
057 ITAB-ETENR,
065 ITAB-INDTEXT(60).
ENDIF.
WRITE:/065 ITAB-F_OLD.
WRITE:/065 ITAB-F_NEW.
ENDLOOP.

FORM READHEADER.
CALL FUNCTION 'CHANGEDOCUMENT_READ_HEADERS'
EXPORTING
DATE_OF_CHANGE = CDHDR-UDATE
OBJECTCLASS = CDHDR-OBJECTCLAS
OBJECTID = CDHDR-OBJECTID
TIME_OF_CHANGE = CDHDR-UTIME
USERNAME = CDHDR-USERNAME
TABLES
I_CDHDR = ICDHDR
EXCEPTIONS
NO_POSITION_FOUND = 1
OTHERS = 2.

CASE SY-SUBRC.
WHEN '0000'.
WHEN '0001'.
MESSAGE S311.
LEAVE.
WHEN '0002'.
MESSAGE S311.
LEAVE.
ENDCASE.
ENDFORM.

FORM READPOS.
LOOP AT ICDHDR.
CHECK ICDHDR-UDATE
IN XUDATE.
CHECK ICDHDR-USERNAME
IN XNAME.
CALL FUNCTION 'CHANGEDOCUMENT_READ_POSITIONS'
EXPORTING
CHANGENUMBER = ICDHDR-CHANGENR
TABLEKEY = CDPOS-TABKEY
TABLENAME = CDPOS-TABNAME
IMPORTING
HEADER = CDHDR
TABLES
EDITPOS = ICDSHW
EXCEPTIONS
NO_POSITION_FOUND = 1
OTHERS = 2.
CASE SY-SUBRC.
WHEN '0000'.
LOOP AT ICDSHW.
CHECK ICDSHW-CHNGIND NE 'E'.
CLEAR ITAB.
MOVE-CORRESPONDING ICDHDR TO ITAB.
MOVE-CORRESPONDING ICDSHW TO ITAB.
CASE ITAB-TABNAME.
WHEN 'KONVC'.
MOVE ICDHDR-OBJECTID TO ITAB-VBELN.
MOVE ICDSHW-TABKEY(6) TO ITAB-POSNR.
WHEN OTHERS.
MOVE ICDSHW-TABKEY+3(10) TO ITAB-VBELN.
MOVE ICDSHW-TABKEY+13(6) TO ITAB-POSNR.
MOVE ICDSHW-TABKEY+19(4) TO ITAB-ETENR.
ENDCASE.
MOVE '& %' TO ITAB-INDTEXT.
APPEND ITAB.
CLEAR ITAB.
ENDLOOP.
WHEN OTHERS.
MESSAGE S311.
LEAVE.
ENDCASE.
ENDLOOP.
ENDFORM.


TOP-OF-PAGE.
WRITE:/ SY-DATUM,SY-UZEIT,
50 'SALES ORDER CHANGE HISTORY',
120 'Page', SY-PAGNO.
WRITE: / SY-REPID,
60 'SALES ORDERS STATISTICS'.
SKIP.
ULINE.
IF SUDATE = 'X'.
WRITE:/001 'Change Date',
013 'Time',
023 'User Name',
037 'Sale Order',
049 'Line',
057 'Sch No',
065 'Changes'.
ELSEIF SOBID = 'X'.
WRITE:/001 'Sale Order',
013 'Line',
021 'Sch No',
029 'Change Date',
041 'Time',
051 'User Name',
065 'Comment'.
ELSE.
WRITE:/001 'User Name',
015 'Time',
025 'Change Date',
037 'Sale Order',
049 'Line',
057 'Sch No',
065 'Changes'.
ENDIF.
ULINE.
*--- End of Program

SAP SD Reports

List of Sales Documents List of sales documents is function provided in system to list Sales & Distribution documents like Sales Orders, Billing Documents etc. This function is a worklist wherein list of such orders / billing documents are available based on selection criteria and can be worked on directly from list.

A. List of Sales Orders We will see list of Sales Orders now Menu Path: Logistics → Sales and Distribution → Sales → Information System → Orders → VA05 – List of Sales Orders

Double click ‘VA05 – List of Sales Orders’ Above screen is displayed Following input options are available: Sold-to Party Material Purchase Order no. (Customer reference) Date selection for period Further selection criteria includes check boxes for selecting either Open Sales Orders All Orders My orders – Orders created by user

In addition to this the Organizational Data needs to be maintained. Click on Enter selection here, Only Sales Organization is mandatory. Click Let’s search for all orders for material M-10.
Enter M-10 in Material and click on Here it displays all the orders for Material ‘M-10’ for selection period. To view any of the sales order select order line and click on In main screen there is also option to add on the selection criteria by clicking on further details