Table VBUP
Hi, can anyone advise how and when is field VBUP-FKSTA get updated? I created a SO, completed delivery and billing. However, this field is still blank when select the SO number. Is there anything i missed out?
Thanks
PP
Dear PP,
Field VBUP-FKSTA stands for Billing status of delivery-related billing documents.
This will get update when you complete the billing document for the delivery document.
So please check your billing document is order relevant billing
or delivery related billing.
If your billing document is delivery related billing document then check the accounting release status if not release release to accounting then check.
I hope this will help you,
Regards,
Murali.
Edited by: Murali Mohan.Tallapaneni on Nov 6, 2008 9:44 AM
Similar Messages
-
Is there a function module or BAPI to change the field UVP03 in table VBUP
When certain conditions are in place I need to change the value of VBUP-UVP03 (items reserve status 3) to a value of C).
there must be a FM or bapi to do this - thanks.
ScottWe had to do this from a custom program that runs in a batch job. It changes a field in VBAP using the BAPI_SALESORDER_CHANGE - that in turn will execute a user exit called userexit_set_status_vbup, that we added code to update the field vbup-uvp03. it works.
-
No Change Document in outbound queue for customer status in table VBUP
Hello all,
we face the following issue. A customer status (UVP04), changed by a customer program, is not written in the outbound queue (lbwq) to transfer it in the business warehouse.
I checked several Function modules (VERKBELG_WRITE_DOCUMENT, MCEX_UPDATE_CALL_11.....) without success.
Any help would be appreciated.
jgSolution found: Dummy change with VA02, that generates a new record in the outbound queue.
-
Data inconsistency problem TABLES: VBUK/VBUP vs VBAK/VBAP
Hi,
I have the fun task of trying to solve a data inconsistency problem caused by a faulty network connection between R/3 and our SQL server.
To add to the fun my knowledge of the outbound systems is pretty close to zero.
Apparently our warehouse was booking stock and after booking they process the STO NO in VL10B.
While posting the outbound in VL02n some of the lines did not generate.
So they deleted the outbound and tried again.
After they finished playing around and our connections acted funky, I now have data for the outbound in tables VBUP/VBUK (Outbound status tables), but seemingly nowhere else.
There is no data in ekpo, lips, vbak or vbap.
So the question is:
How on earth do I get rid of these entries safely, or otherwise try to generate the missing data?
Just changing the statuses to completed did not work as they end up having problems when trying to pick more stock on articles that had entries on the missing outbound.
Any other ideas?
What other tables do I need to check for entries?
Thanks
Charl
Message was edited(typos) by:
Charl HoltzhausenHi,
With the help of SAP we solved the problem.
Apart from VBUP/VBUK there was data in table VBBE (stock movement).
Deleting the entries in these cleared the problem.
It was important to check that further STOs were not adversely affected, which it seems it was not.
Regards -
Billing Status filed FKSTA in table VBUK/VBUP is not updating
Dear All
In order to billing scenario, though the cycle is completed as
OR-DEL-BIL-ACCT DET.
All status shows completed still In place of billing status(FKSTA) it shows blank .
Document Status:
order completed
Delivery completed
picking request completed
Goods Issue:delivery completed
invoice(F2) completed
Accounting Document cleared
Where is the problem i don't exactly understand.
IS THERE ANY SAP NOTE to implement
So, please help me regard this issue.URGENT
Thanks in advance
MaheshHi,
Carry out Report RVDELSTA which is contained in your system to correct the delivery status.
This report will compare the status of the delivery and will re-update the tables VBUP and VBUK.
try to execute the delivery using this report and hope it will resolve your issue.
Regards,
Saju.S -
Sales order item level partial delivery field table and field?
Will anyone share your expertise, In SD sales order level, at item what is the table and field name in which the partial delivery status is stored. I want the table and field name?. will anyone share pl.
Hi,
Try with table VBUP - and field LFSTA.
Regards -
Table for Outstanding orders and deliveries
Hi,
I have a requirement where I need to findout what is the outstanding quantity for an article (material). I need what is the wuantity in the sales order, and for how many quantities, the PGI is done for that sales order. So accordingly I can find out the outstanding quantity.
Can anybdy please let me know which table should I look for Sales order quantity and PGI quantity so that I can findout the outstanding quantity for a material.
Thanks & Regards
SatyaHi Satya,
There is no one table where you can get this information. I would use the logic below for this requirement.
For the sales order item check the delivery status field in table VBUP. There are 3 possibilities here.
1) If the value is 'A' = Not yet processed, then the delivery quantity is zero and hence the entire line item quantity is pending
2) If the value is 'C' = Completely processed, then all quantities have been delivered and hence outstanding quantity is zero
3) If the value is 'B' = Partially processed, then using VBFA table identify all the deliveries for this line and then using LIPS table find out the total delivered quantities.
Regards,
Pratheb -
Reg. DB Table for SD Order item which is billing relevant
Dear Experts,
My requirement is that for each WBS Element, i need the SD Order item which is relevant for billing to enable the report to check whether final billing was done. If final billing was done for all line items the report will select the latest billing date at least three months ago. What is the Database Table i need to look into? Kindly help me in this regard.
Thanks,
Ramesh ManoharanWhat data you are looking for the database tables??
Guess,
you will get WBS element from VBAP table, Key in WBS element in this table & you will get all SD orders with Item Category (PSTYV).
with this Item Category, Goto Table:TVAP to check whether item is relevant for billing or not
sort all the SD orders with TVAP_FKREL ne "blank" ,
Now check the status of SD orders @ item level from Table:VBUP ( if billing is done SD order status will get updated as"Complete") , To find out the Billing no, Use doc flow table:VBFA with subseq doc cat:M ( applicable invoice doc cat's) & SD order as selection criteria. -
Maintaining the history of delivery in VBUP
Hi experts,
In table VBUP we can get the current status of the delivery for sales orders .
Field - wbsta if its A = Open ,B = Partial. c = Completed.
For example : i am creating a sales order on 10-12-2011 , Quantity = 10
Current status will be A (Open) on date 10-12-2011
If i am doing delivery of 5 on 15-12-2011 . the status will be B (partial)
If i am doing the full delivery of 10 on 20-12-2011 the current status will be C(completed)
In just want to know the status as B on 15-12-2011.
Is there any table where we will the old history of Item status?
Regards,
Ajay.No change history is maintained for status field on orders (or for that matter any sales document). The status fields are automatically updated by SAP and are not maintainable to by the user, so they are not tracked for change documents (CDHDR/CDPOS tables) which are for tracking user changes.
You can verify that in SE11 for data element WBSTA linked to VBUP-WBSTA, the "Change document" flag is disabled in "Further characteristics" tab. -
Hi,
Plz tell me from which table I can extract the sales order number, sales order stock for a particular line item (material). Also tell me the important SD tables.
Thanks,
Sachin
Edited by: Sachin PP on Dec 5, 2008 7:05 AMDear Sachin,
--> To extract Sales Order Number:
Table-Field: VBAK-VBELN
--> To Check, sales order stock for a particular line item
Table: VBUP - Sales Document: Item Status
To check Important Tables in SD, Please refer:
[Imp SD Tables|http://www.sap-img.com/sap-sd/important-tables-for-sap-sd.htm]
[Imp. SD Tables|http://abaplovers.blogspot.com/2008/02/table-description-vbakuk-sales-document.html]
[SAP Table Relation|http://www.abap.es/Descargas/TAB%20-%20Relacion%20de%20las%20tablas%20por%20modulos.PDF]
Best Regards,
Amit -
Tables releated to MIRO and VF01
Hi Experts,
After posting documents from MIRO and VF01 tcodes , which tables are updated .
Plz tell me details procedure for that.
Regards,
JyotsnaMIRO: Vendor Invoice Posting
This creates an Open Item for Vendor Payment in the Accounting Tables. Tables to be hit:
BKPF: Accounting Document Header Table.
BSEG: Accouting Document Line ITem Table.
BSIS: Accounting Document Open Items Only
BSIK: Accouting Documet Open Items for Vendor Only
VF01: Customer Invoice Creation
This creates an Invoice for the Customer. Tables to be hit:
VBRK: Invoice Document Header Table
VBRP: Invoice Document Line Iten Table
VBFA: SD Document Flow Table
VBUK: SD Document Header Status Table
VBUP: SD Document Line Iten Status Table -
Regarding field VBUP-PKSTA (Packing status of an item)
Helo All,
Can anybody tell me from where does the field PKSTA in table VBUP gets populated?
This is regarding packing status of item.
Thanks in advance.Thanks for your reply.
But when delivery is created, the field is populated from VBUP-PKSTA (Packing status).
My question is how entry is made in this table VBUP?
Is it when we create any master data or during any config?
Thanks. -
Open sale order quantity in VA05
hi all,
can anyone please tell me the function module or bapi or Table to find out open sales order quantity coming in VA05.
regards.First of all define what is open , is it created but notdelivered , or delivered but not invoiced.
The table VBUP has flags for statuses eg
A Not yet processed
B Partially processed
C Completely processed
A for open , B for partial C for complete , so by checking this table you will find which are actually delivered or invoiced completely.
Tcode V.02 gives u this option. -
Hello Friends
I want to find if anybody can guide me on how to get all open sales order tables , i want to create a format and create a flat file for uplodading the file , for this what do i need and how do i do it.
Also for creating LSWM can i use the existing one which i can just Assign the New file to the existing one .
Regards.Dear Mehmood,
I want to find if anybody can guide me on how to get all open sales order tables
You want to extract all the open sales orders- which you can get from Table:VBUP key in overall document status in selection screen ( You can use VBUK also- but if there are certain sales orders in which some of the items are completed or few of them open, using VBUK - you will not get exact records)
Secondly, you can get the data by using Query also- in SQVI
design a query with VBAK / VBAP & VBUP
so that from VBAK you can give time period & sales area details
from VBAP - you can enter plant relevant details to filter certain records & item category as well
where as VBUP- filter wth the status.
once downloaded store in flat file.
Now Create LSMW object by using batch input recording method. after mapping the relevant fields,
prepare the flat file in such a - it suits to the upload file / recording file. then you can upload the already downloaded n stored open sales orders in flat file.
Hope this is what you are looking for.
Regards,
ReazuddinMD -
Print smartform from background
Dear Experts,
I have requirement to create delivery then create bill automatically so i open background job from program (A) and submit the creating program for bill (B) via this job what happened is the delivery creating is ok, the delivery printing is ok and the billing creation is ok but the billing printing program (C) is not ok where the spool is creating with status waiting so can any body help how to print from background job??
program (A) (Create backgroundjob and submit program via it)
FORM USEREXIT_SAVE_DOCUMENT.
DATA: jobcount TYPE tbtcjob-jobcount,
new_time type TBTCJOB-SDLSTRTTM.
data : p_vbeln TYPE likp-vbeln.
DATA : v_JOB_WAS_RELEASED LIKE BTCH0000-CHAR1.
break rurik.
if T180-TRTYP = 'H'
and ( likp-lfart = 'ZDCF'
or likp-lfart = 'ZDCI'
or likp-lfart = 'ZDCO'
or likp-lfart = 'ZDCP'
or likp-lfart = 'ZDCR'
or likp-lfart = 'ZDOB'
or likp-lfart = 'ZDOT'
or likp-lfart = 'ZDQT'
or likp-lfart = 'ZDRE' - Ian
or likp-lfart = 'ZDSO').
CALL FUNCTION 'JOB_OPEN'
EXPORTING
jobname = 'SD_AUTOMATION'
SDLSTRTDT = NO_DATE
SDLSTRTTM = NO_TIME
JOBCLASS =
IMPORTING
JOBCOUNT = jobcount
CHANGING
RET =
EXCEPTIONS
CANT_CREATE_JOB = 1
INVALID_JOB_DATA = 2
JOBNAME_MISSING = 3
OTHERS = 4.
SUBMIT zsd_create_billing_document
with vbeln EQ LIKP-VBELN
AND RETURN
VIA JOB 'SD_AUTOMATION'
NUMBER jobcount.
new_time = sy-uzeit + 10. "short delay
CALL FUNCTION 'JOB_CLOSE'
EXPORTING
jobcount = jobcount
jobname = 'SD_AUTOMATION'
STRTIMMED = 'X'
SDLSTRTDT = sy-datum
SDLSTRTTM = new_time
IMPORTING
JOB_WAS_RELEASED = v_JOB_WAS_RELEASED
EXCEPTIONS
CANT_START_IMMEDIATE = 1
INVALID_STARTDATE = 2
JOBNAME_MISSING = 3
JOB_CLOSE_FAILED = 4
JOB_NOSTEPS = 5
JOB_NOTEX = 6
LOCK_FAILED = 7
INVALID_TARGET = 8
OTHERS = 9
ENDIF.
ENDFORM.
Program B (Creat bill)
REPORT zsd_create_billing_document
NO STANDARD PAGE HEADING LINE-SIZE 255.
TABLES: vbup, vbak, vbuk.
DATA: bdcdata LIKE bdcdata OCCURS 0 WITH HEADER LINE.
DATA done(1).
PARAMETERS vbeln TYPE likp-vbeln.
DATA sal_vbeln TYPE vbeln..
DATA messtab LIKE TABLE OF bdcmsgcoll WITH HEADER LINE.
DATA billing_doc TYPE vbeln.
DATA messagetext(200).
MESSAGE s002(zsd).
WRITE: / vbeln.
DATA : v_print TYPE i.
CALL FUNCTION 'ENQUEUE_EVVBLKE'
EXPORTING
MODE_LIKP = 'E'
MANDT = SY-MANDT
vbeln = vbeln
X_VBELN = ' '
_SCOPE = '2'
_wait = 'X'
" _wait = space
_COLLECT = ' '
EXCEPTIONS
foreign_lock = 1
system_failure = 2
OTHERS = 3
MESSAGE s005(zsd).
*In case ZSOT automatic billing once we create delivery and post goods issue manual.
SELECT SINGLE vbelv
FROM vbfa
INTO sal_vbeln
WHERE vbeln = vbeln
AND vbtyp_v = 'C'.
SELECT SINGLE *
FROM vbak
WHERE vbeln = sal_vbeln.
import v_print to v_print FROM MEMORY id 'PRINTFLAG'.
IF vbak-auart EQ 'ZSOT'.
IF v_print eq '1'.
PERFORM create_document USING vbeln
CHANGING sy-subrc.
ENDIF.
ELSE.
*Other than ZSOT Post Goods issue from ZPGI2 and from there automatic billing.
ENDIF.
*& Form CREATE_DOCUMENT
text
-->P_VBELN text
FORM create_document USING p_vbeln
CHANGING sysubrc.
PERFORM bdc_dynpro USING 'SAPMV60A' '0102'.
PERFORM bdc_field USING 'BDC_CURSOR'
'KOMFK-VBELN(01)'.
PERFORM bdc_field USING 'BDC_OKCODE'
'/00'.
PERFORM bdc_field USING 'KOMFK-VBELN(01)'
p_vbeln."'1130010202'.
PERFORM bdc_dynpro USING 'SAPMV60A' '0104'.
PERFORM bdc_field USING 'BDC_CURSOR'
'VBRK-FKART'.
PERFORM bdc_field USING 'BDC_OKCODE'
'=SICH'.
CALL FUNCTION 'DEQUEUE_EVVBLKE'
EXPORTING
MODE_LIKP = 'E'
MANDT = SY-MANDT
vbeln = vbeln
X_VBELN = ' '
_SCOPE = '3'
_SYNCHRON = ' '
_COLLECT = ' '
CALL TRANSACTION 'VF01' USING bdcdata
MODE 'N'
UPDATE 'S'
MESSAGES INTO messtab.
READ TABLE messtab WITH KEY msgtyp = 'E'.
IF sy-subrc EQ 0.
sysubrc = 4.
ELSE.
sysubrc = 0.
ENDIF.
LOOP AT messtab.
sy-msgty = messtab-msgtyp.
sy-msgid = messtab-msgid.
sy-msgno = messtab-msgnr.
sy-msgv1 = messtab-msgv1.
sy-msgv2 = messtab-msgv2.
sy-msgv3 = messtab-msgv3.
sy-msgv4 = messtab-msgv4.
CALL FUNCTION '/SAPTRX/GET_MESSAGE_TEXT'
EXPORTING
msgid = sy-msgid
msgno = sy-msgno
msgv1 = sy-msgv1
msgv2 = sy-msgv2
msgv3 = sy-msgv3
msgv4 = sy-msgv4
IMPORTING
messagetext = messagetext
EXCEPTIONS
no_message_retrieved = 1
OTHERS = 2.
WRITE: / messagetext.
CLEAR messagetext.
ENDLOOP.
*... refresh tables
REFRESH: messtab, bdcdata.
ENDFORM. "CREATE_DOCUMENT
*& Form BDC_DYNPRO
text
-->PROGRAM text
-->DYNPRO text
FORM bdc_dynpro USING program dynpro.
CLEAR bdcdata.
bdcdata-program = program.
bdcdata-dynpro = dynpro.
bdcdata-dynbegin = 'X'.
APPEND bdcdata.
ENDFORM. "BDC_DYNPRO
Insert field *
FORM bdc_field USING fnam fval.
CLEAR bdcdata.
bdcdata-fnam = fnam.
bdcdata-fval = fval.
APPEND bdcdata.
ENDFORM. "BDC_FIELD
*& Form change_status
text
--> p1 text
<-- p2 text
FORM change_status .
*Change status if delivery and the billing document has been created
SELECT *
FROM vbup
WHERE vbeln = vbeln
AND fksta NE 'C'.
vbup-fksta = 'C'.
vbup-gbsta = 'C'.
MODIFY vbup.
ENDSELECT.
UPDATE vbuk
SET fkstk = 'C'
gbstk = 'C'
WHERE vbeln = vbeln.
ENDFORM. " change_status
Program C (Print Bill)
REPORT z_sdps_invoice.
*& <Module>: SD Smart Forms.
*& Type : Executable
*& Request No.:
*& Author/Co. : Ahmed Al Eryani
*& Created On : 26.02.2007
*& Finished : 24.2007
*& Description:
*& MODIFICATION LOG
*& Modified by :
*& Request No. :
*& Dev. Class :
*& Date Modified:
*& Description :
TABLES: vbrk, kna1, vbrp, makt, konv, vbkd.
SELECTION-SCREEN BEGIN OF BLOCK a.
PARAMETER: p_vbeln LIKE vbrp-vbeln OBLIGATORY MATCHCODE OBJECT vmcf. "Billing document No
"SELECT-OPTIONS s_bukrs FOR bkpf-bukrs. "Company Code
SELECTION-SCREEN END OF BLOCK a.
*itab is object of our smart form structre
DATA: itab TYPE zsd_invoice OCCURS 0 WITH HEADER LINE.
DATA: wa_footer TYPE zsd_invv1.
DATA: t_items TYPE zsd_inv WITH HEADER LINE,
w_items TYPE LINE OF zsd_inv,
it_footer TYPE zsd_inv1,
w_footer TYPE LINE OF zsd_inv1.
DATA: amountspell LIKE spell.
DATA: g_fm_name TYPE rs38l_fnam.
DATA: mnumvflag(10) TYPE c.
DATA: coun TYPE i,
totalforitems TYPE kwert,
lasttotal(8) TYPE p DECIMALS 2,
lasttotalc(11) TYPE c,
firstpart(11) TYPE c,
secondpart(2) TYPE c.
DATA: currency TYPE waerk.
DATA: currtxet(50) TYPE c.
*Header internal table
DATA: BEGIN OF t_header OCCURS 0,
vbeln LIKE vbrk-vbeln,"Document no
name1 LIKE kna1-name1,"Customer Name
adrnr LIKE kna1-adrnr,"Customer Address
bstkd LIKE vbkd-bstkd,"
kunnr LIKE kna1-kunnr,"Customer Account no
waerk LIKE vbrk-waerk, "currency key
aubel LIKE vbrp-aubel,
kunrg LIKE vbrk-kunrg,
street LIKE adrc-street,
fkart LIKE vbrk-fkart,
lgort LIKE lips-lgort,"Stord bin
lgobe LIKE t001l-lgobe,
ktokd LIKE kna1-ktokd,
PSTYV LIKE vbrp-PSTYV,
orgbil LIKE vbfa-vbelv,
END OF t_header.
*detail internal table
DATA: BEGIN OF t_items1 OCCURS 0,
matnr LIKE vbrp-matnr,"Material Number
posnr LIKE vbrp-posnr,
vgpos LIKE vbrp-vgpos,
maktx LIKE makt-maktx,"Material Description
lgort LIKE vbrp-lgort,"Storage location
fkimg LIKE vbrp-fkimg,"
knumv LIKE vbrk-knumv,"
unitprice LIKE konv-kawrt,
total LIKE konv-kawrt,
waers LIKE konv-waers,
kkurs LIKE konv-kkurs,
vgbel LIKE vbrp-vgbel,
lgpbe LIKE lips-lgpbe,
vgtyp LIKE vbrp-vgtyp,
END OF t_items1.
DATA: v_belnr TYPE belnr_d.
*Unit price internal table
DATA: BEGIN OF t_untprice OCCURS 0,
kschl LIKE konv-kschl,"condition type
kawrt LIKE konv-kawrt,"unit price
END OF t_untprice.
*Condition(spcial deduction)
DATA: BEGIN OF t_spcialcnd OCCURS 0,
kschl LIKE konv-kschl,"condition type
kwert LIKE konv-kwert,"Deduction value
END OF t_spcialcnd.
DATA: t_tax LIKE TABLE OF t_spcialcnd WITH HEADER LINE,
v_tax LIKE konv-kwert.
DATA: BEGIN OF t_curtxt OCCURS 0,
ltext LIKE tcurt-ltext,
END OF t_curtxt.
DATA :return_code TYPE i," VALUE 999,
us_screen TYPE c. "VALUE 'X'.
declaration of data
INCLUDE rlb_invoice_data_declare.
definition of forms
INCLUDE rlb_invoice_form01.
INCLUDE rlb_print_forms.
START-OF-SELECTION.
"IF p_vbeln IS NOT INITIAL.
PERFORM entry USING return_code us_screen.
"ENDIF.
FORM ENTRY
FORM entry USING return_code us_screen.
DATA: lf_retcode TYPE sy-subrc.
CLEAR retcode.
xscreen = us_screen.
perform processing using us_screen
changing lf_retcode.
if lf_retcode ne 0.
return_code = 1.
else.
return_code = 0.
endif.
IF p_vbeln IS INITIAL.
p_vbeln = nast-objky.
ENDIF.
"get header data
SELECT SINGLE vbrk~vbeln vbrk~waerk vbrp~aubel vbrk~kunrg vbrk~fkart vbrp~lgort vbrp~PSTYV
INTO (t_header-vbeln, t_header-waerk, t_header-aubel, t_header-kunrg, t_header-fkart,
t_header-lgort, t_header-PSTYV)
FROM vbrk JOIN vbrp ON vbrp~vbeln = vbrk~vbeln
JOIN kna1 ON vbrk~kunrg = kna1~kunnr
WHERE vbrk~vbeln = p_vbeln.
IF t_header-PSTYV = 'ZREN'.
SELECT SINGLE VBELV
INTO t_header-orgbil
FROM vbfa
WHERE vbeln = p_vbeln
and VBTYP_V = 'M'.
ENDIF.
SELECT SINGLE t001l~lgobe
INTO t_header-lgobe
FROM t001l
WHERE t001l~lgort = t_header-lgort.
SELECT SINGLE kna1~name1 kna1~adrnr kna1~kunnr kna1~ktokd
INTO (t_header-name1, t_header-adrnr, t_header-kunnr, t_header-ktokd)
FROM kna1 "ON vbrk~kunrg = kna1~kunnr
WHERE kna1~kunnr = t_header-kunrg
AND spras = 'AR'.
IF t_header-name1 IS INITIAL.
SELECT SINGLE kna1~name1 kna1~adrnr kna1~kunnr kna1~ktokd
INTO (t_header-name1, t_header-adrnr, t_header-kunnr, t_header-ktokd)
FROM kna1 "ON vbrk~kunrg = kna1~kunnr
WHERE kna1~kunnr = t_header-kunrg
AND spras = 'EN'.
ENDIF.
IF t_header-ktokd = 'ZONE'.
SELECT SINGLE belnr
INTO v_belnr
FROM bkpf
WHERE xblnr = p_vbeln.
SELECT SINGLE name1
INTO t_header-name1
FROM bsec
WHERE belnr = v_belnr.
ENDIF.
SELECT SINGLE adrc~street
INTO t_header-street
FROM adrc
WHERE addrnumber = t_header-adrnr
AND langu = 'AR'.
IF t_header-street IS INITIAL.
SELECT SINGLE adrc~street
INTO t_header-street
FROM adrc
WHERE addrnumber = t_header-adrnr
AND langu = 'EN'.
ENDIF.
"get details data
SELECT vbrp~matnr vbrp~posnr vbrp~vgpos vbrp~fkimg
vbrk~knumv vbrp~matnr vbrp~vgbel vbrp~vgtyp"makt~maktx
INTO CORRESPONDING FIELDS OF TABLE t_items1
FROM vbrp "JOIN makt ON vbrp~matnr = makt~matnr
JOIN vbrk ON vbrp~vbeln = vbrk~vbeln
"join konv on vbrk~knumv = konv~knumv
WHERE vbrp~vbeln = p_vbeln
AND vbrp~fkimg NE '0.000'.
"AND makt~spras = 'E'.
break arasmy.
LOOP AT t_items1.
SELECT SINGLE lips~lgpbe
INTO t_items1-lgpbe
FROM lips
WHERE vbeln = t_items1-vgbel
AND posnr = t_items1-vgpos.
SELECT SINGLE makt~maktx
INTO t_items1-maktx
FROM makt
WHERE matnr = t_items1-matnr
AND makt~spras = 'EN'.
SELECT SINGLE konv~kbetr konv~kwert konv~waers konv~kkurs
INTO (t_items1-unitprice, t_items1-total, t_items1-waers,
t_items1-kkurs)
FROM konv
WHERE konv~kschl = 'NETW'"'ZSPC' "'ZSP1'
AND konv~knumv = t_items1-knumv
AND kposn = t_items1-posnr.
t_items1-unitprice = ( t_items1-total / t_items1-fkimg ) * t_items1-kkurs.
MODIFY t_items1.
mnumvflag = t_items1-knumv."Number of the document condition
ENDLOOP.
*get the deduction value for the document condiotion no
SELECT konvkschl konvkwert
INTO CORRESPONDING FIELDS OF TABLE t_spcialcnd
FROM konv
WHERE konv~kschl IN ('ZSSD', 'ZSCD', 'ZSDD', 'ZSPD', 'ZSWD', 'ZMW1', 'ZSGS', 'ZMW2')
AND konv~knumv = mnumvflag.
Get tax 10%
SELECT konvkschl konvkwert
APPENDING CORRESPONDING FIELDS OF TABLE t_tax
FROM konv
WHERE konv~kschl = 'MWST'
AND konv~knumv = mnumvflag.
itab-invn = t_header-vbeln.
itab-orgbil = t_header-orgbil.
itab-cusna = t_header-name1.
itab-addr = t_header-street.
itab-custn = t_header-kunrg.
itab-sord = t_header-aubel.
itab-fkart = t_header-fkart.
itab-lgort = t_header-lgort.
itab-lgobe = t_header-lgobe.
itab-PSTYV = t_header-PSTYV.
currency = t_header-waerk.
LOOP AT t_items1.
w_items-matn = t_items1-matnr.
w_items-matdes = t_items1-maktx.
w_items-stloc = t_items1-lgpbe."lgort.
w_items-qunt = t_items1-fkimg.
w_items-total = t_items1-total.
totalforitems = totalforitems + w_items-total.
COLLECT w_items INTO t_items.
endloop.
LOOP AT t_items1.
LOOP AT t_items WHERE matn = t_items1-matnr.
t_items-prc = t_items1-unitprice.
MODIFY t_items.
ENDLOOP.
ENDLOOP.
LOOP AT t_items.
coun = coun + 1.
t_items-itmn = coun.
MODIFY t_items.
ENDLOOP.
w_footer-totalforitems = totalforitems.
LOOP AT t_spcialcnd.
CASE t_spcialcnd-kschl.
WHEN 'ZSSD'.
w_footer-spdisc = w_footer-spdisc + t_spcialcnd-kwert.
WHEN 'ZSCD'.
w_footer-comdisc = w_footer-comdisc + t_spcialcnd-kwert.
WHEN 'ZSDD'.
w_footer-DIFMAT = w_footer-DIFMAT + t_spcialcnd-kwert.
when 'ZSPD'.
w_footer-trgtdisc = w_footer-trgtdisc + t_spcialcnd-kwert.
WHEN 'ZMW2'.
w_footer-comindisc = w_footer-comindisc + t_spcialcnd-kwert.
WHEN 'ZSWD'.
w_footer-cshdisc = w_footer-cshdisc + t_spcialcnd-kwert.
WHEN 'ZSGS'.
w_footer-stampsdisc = w_footer-stampsdisc + t_spcialcnd-kwert.
ENDCASE.
w_footer-ttldisc = w_footer-spdisc + w_footer-comdisc + w_footer-trgtdisc
+ w_footer-cshdisc + w_footer-DIFMAT + w_footer-stampsdisc.
ENDLOOP.
w_footer-aftrdiscnts = w_footer-totalforitems + w_footer-ttldisc.
LOOP AT t_tax WHERE kwert NE '0.00'.
w_footer-saltax = w_footer-saltax + t_tax-kwert.
ENDLOOP.
w_footer-totalaftrtax = w_footer-aftrdiscnts + w_footer-saltax.
w_footer-total = w_footer-totalaftrtax + w_footer-comindisc.
lasttotal = w_footer-total.
APPEND w_footer TO it_footer.
SELECT tcurt~ltext
INTO CORRESPONDING FIELDS OF TABLE t_curtxt
FROM tcurt
WHERE tcurt~spras = 'AR'
AND tcurt~waers = currency.
LOOP AT t_curtxt.
currtxet = t_curtxt-ltext.
ENDLOOP.
itab[] = t_header[].
lasttotalc = lasttotal.
SPLIT lasttotalc AT '.' INTO firstpart secondpart.
lasttotal = firstpart / 100.
CALL FUNCTION 'SPELL_AMOUNT'
EXPORTING
amount = lasttotal
currency = ''"CURRENCY
filler = space
language = 'A'
IMPORTING
in_words = amountspell
EXCEPTIONS
not_found = 1
too_large = 2
OTHERS = 3.
IF sy-subrc <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
--split amount--
BREAK radha.
CALL FUNCTION 'SSF_FUNCTION_MODULE_NAME'
EXPORTING
formname = 'Z_INVOICE_PARTS2'
VARIANT = ' '
DIRECT_CALL = ' '
IMPORTING
fm_name = g_fm_name
EXCEPTIONS
no_form = 1
no_function_module = 2
OTHERS = 3
IF sy-subrc <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
DATA : control_parameters TYPE ssfctrlop,
print_options TYPE ssfcompop.
DATA : document_output_info TYPE ssfcrespd,
job_output_info TYPE ssfcrescl,
job_output_options TYPE ssfcresop.
DATA : count TYPE i.
control_parameters-langu = 'AR'.
control_parameters-no_dialog = 'X'."Don't show Dialog
print_options-tdarmod = '1'.
print_options-tdcopies = '001'.
print_options-tddest = 'LP02'.
print_options-tdprinter = 'ZARSWIN'.
print_options-tdimmed = 'X'.
print_options-tddelete = 'X'.
print_options-tdlifetime = '8'.
print_options-tddest = 'LP03'."nast-ldest.
"print_options-tddest = nast-ldest.
"print_options-tdcopies = pv_copies.
print_options-tddelete = 'X'.
print_options-tdfinal = 'X'.
print_options-tdnewid = 'X'.
WHILE count ne 1.
IF job_output_info-outputdone ne 'X'.
CALL FUNCTION g_fm_name
EXPORTING
ARCHIVE_INDEX =
ARCHIVE_INDEX_TAB =
ARCHIVE_PARAMETERS =
control_parameters = control_parameters
MAIL_APPL_OBJ =
MAIL_RECIPIENT =
MAIL_SENDER =
output_options = print_options
user_settings = space
header = itab
amountspell = amountspell
currtxt = currtxet
secondpart = secondpart
wa_footer = w_footer
IMPORTING
DOCUMENT_OUTPUT_INFO = document_output_info
JOB_OUTPUT_INFO = job_output_info
JOB_OUTPUT_OPTIONS = job_output_options
TABLES
it_items = t_items
it_footer = it_footer
EXCEPTIONS
formatting_error = 1
internal_error = 2
send_error = 3
user_canceled = 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.
ENDFORM. "ENTRYHi,
lw_control_param-device = 'PRINTER'.
lw_control_param-getotf = c_x.
lw_control_param-no_dialog = c_x.
lw_composer_param-tdnoprev = c_x.
<b>*lw_composer_param-tddest = 'LONSC0P310'.</b>
<b>lw_composer_param-tddest = 'XXXX'.</b> <b>"Four digits</b>
<i>lw_composer_param-tdnewid = c_x.
lw_composer_param-tdfinal = c_x.</i> --> Not required
In place of 'XXXX', replace it by a 4 digit value. It would be available in transaction SPAD->Output Devices->Double click your output device. On the right hand side there would be a field Short Name. Replace 'XXXX' with that value.
Best regards,
Prashant
Maybe you are looking for
-
How do I move iTunes music content from one computer to another?
I need to move iTunes content from an older MacBook, which serves as the music source for our audio system, to a new Mac mini, which will now do the same. I know to move the folder in the music folder but I would like to make certain the playlists ar
-
IPhoto photo libraries not showing up in iTunes
I have a 16gb iPod touch and I just noticed today after updating both iTunes and the iPod firmware Tuesday that my iPhoto libraries are no longer showing up in either one. The photos are all syncing, but they show up under "Photo Library", instead of
-
I have figured out how to use PSE brilliantly with iPhoto by keeping (and saving) everything as jpeg's. But if I open from iphoto with PSE as my external editor, and save as a PSD, I am prompted to save in the iphoto library. However, when I go back
-
Objects, Overloading, and Stock Prices
The problem - Write a program that has the following: Data: A string field named symbol for the Stock’s symbol. A a string named sName for the Stock’s name. A double field named previousClosingPrice that stores the stock’s prices form the previous da
-
How paste PDF page into Adobe Reader?
I have copied a table from a web page that has a PDF button, but how do I paste that into Adobe Reader?