Document number not updating in the document
hi gurus,
this is a excise invoice voucher form used by the client .
some values are not updated in document no.
could someone tell me why it is not updating.
if there are any corrections in code pls update me and solve my problem.
urs
pradeep.r
*& Include ZFI_PAY_ADVICE_F01_STR_2 *
*& Form select_data
text
--> p1 text
<-- p2 text
FORM SELECT_DATA .
REFRESH IT_BKPF.
CLEAR IT_BKPF.
SELECT BELNR GJAHR XBLNR BLDAT BLART INTO CORRESPONDING FIELDS OF
TABLE IT_BKPF FROM BKPF
WHERE BELNR IN S_BELNR
AND GJAHR IN S_GJAHR
AND BUKRS IN S_BUKRS.
IF IT_BKPF[] IS INITIAL.
MESSAGE S001.
ENDIF.
SORT IT_BKPF BY BELNR GJAHR.
LOOP AT IT_BKPF.
SELECT SINGLE EBELN WRBTR WERKS LIFNR KUNNR INTO
(IT_BKPF-ZUONR,IT_BKPF-WRBTR,IT_BKPF-WERKS,IT_BKPF-LIFNR,IT_BKPF-KUNNR)
FROM BSEG
WHERE BELNR = IT_BKPF-BELNR
AND GJAHR = IT_BKPF-GJAHR
AND BUKRS IN S_BUKRS
AND KOART = 'K'.
IF NOT IT_BKPF-LIFNR IS INITIAL.
DATA : WRK_ADRNR LIKE LFA1-ADRNR.
CLEAR WRK_ADRNR.
SELECT SINGLE ADRNR INTO WRK_ADRNR FROM LFA1
WHERE LIFNR = IT_BKPF-LIFNR.
SELECT SINGLE NAME1
NAME2
NAME3
NAME4
CITY1
REGION
COUNTRY
STREET
INTO (IT_BKPF-NAME1,IT_BKPF-NAME2,IT_BKPF-NAME3,IT_BKPF-NAME4,
IT_BKPF-CITY1,IT_BKPF-REGION,IT_BKPF-COUNTRY,IT_BKPF-STREET)
FROM ADRC
WHERE ADDRNUMBER EQ WRK_ADRNR.
Text for Country
SELECT SINGLE LANDX INTO IT_BKPF-LANDX FROM T005T
WHERE LAND1 = IT_BKPF-COUNTRY
AND SPRAS EQ SY-LANGU.
Text for Region
SELECT SINGLE BEZEI INTO IT_BKPF-BEZEI FROM T005U
WHERE BLAND = IT_BKPF-REGION
AND SPRAS EQ SY-LANGU
AND LAND1 = IT_BKPF-COUNTRY.
ENDIF.
IF NOT IT_BKPF-KUNNR IS INITIAL.
CLEAR WRK_ADRNR.
SELECT SINGLE ADRNR INTO (WRK_ADRNR) FROM KNA1
WHERE KUNNR = IT_BKPF-KUNNR.
SELECT SINGLE NAME1
NAME2
NAME3
NAME4
CITY1
REGION
COUNTRY
STREET
INTO (IT_BKPF-NAME1,IT_BKPF-NAME2,IT_BKPF-NAME3,IT_BKPF-NAME4,
IT_BKPF-CITY1,IT_BKPF-REGION,IT_BKPF-COUNTRY,IT_BKPF-STREET)
FROM ADRC
WHERE ADDRNUMBER EQ WRK_ADRNR.
Text for Country
SELECT SINGLE LANDX INTO IT_BKPF-LANDX FROM T005T
WHERE LAND1 = IT_BKPF-COUNTRY
AND SPRAS EQ SY-LANGU.
Text for Region
SELECT SINGLE BEZEI INTO IT_BKPF-BEZEI FROM T005U
WHERE BLAND = IT_BKPF-REGION
AND SPRAS EQ SY-LANGU
AND LAND1 = IT_BKPF-COUNTRY.
ENDIF.
MODIFY IT_BKPF.
ENDLOOP.
REFRESH IT_DATA.
CLEAR IT_DATA.
LOOP AT IT_BKPF.
DATA : WRK_BSAKBELNR LIKE BSAK-BELNR.
CLEAR WRK_BSAKBELNR.
SELECT SINGLE BELNR INTO WRK_BSAKBELNR FROM BSAK
WHERE AUGBL = IT_BKPF-BELNR
AND GJAHR = IT_BKPF-GJAHR
AND BUKRS IN S_BUKRS.
Advance
IF WRK_BSAKBELNR IS INITIAL.
IT_DATA-VBELNR = IT_BKPF-BELNR.
IT_DATA-BELNR = IT_BKPF-BELNR.
IT_DATA-GJAHR = IT_BKPF-GJAHR.
IT_DATA-XBLNR = IT_BKPF-XBLNR.
IT_DATA-BLDAT = IT_BKPF-BLDAT.
IT_DATA-BLART = IT_BKPF-BLART.
IT_DATA-ZUONR = IT_BKPF-ZUONR.
IT_DATA-WRBTR = IT_BKPF-WRBTR.
IT_DATA-WRBTRC = IT_DATA-WRBTR.
APPEND IT_DATA.
IT_DATA-VBELNR = IT_BKPF-BELNR.
IT_DATA-BELNR = ' '.
IT_DATA-GJAHR = ' '.
IT_DATA-BLDAT = ' '.
IT_DATA-BLART = ' '.
IT_DATA-ZUONR = ' '.
TDS
DATA : WRK_TDSWRBTR LIKE BSIS-WRBTR.
CLEAR WRK_TDSWRBTR.
SELECT SUM( WRBTR ) INTO WRK_TDSWRBTR FROM BSIS
WHERE BELNR = IT_BKPF-BELNR
AND GJAHR = IT_BKPF-GJAHR
AND BUKRS IN S_BUKRS
AND QSSKZ NE SPACE
AND QSSKZ NE 'XX'
AND XREF3 NE SPACE
AND QSSKZ NE 'S1'
AND QSSKZ NE 'S2'.
IF WRK_TDSWRBTR IS INITIAL.
SELECT SUM( WRBTR ) INTO WRK_TDSWRBTR FROM BSAS
WHERE BELNR = IT_BKPF-BELNR
AND GJAHR = IT_BKPF-GJAHR
AND QSSKZ NE SPACE
AND QSSKZ NE 'XX'
AND XREF3 NE SPACE
AND BUKRS IN S_BUKRS
AND QSSKZ NE 'S1'
AND QSSKZ NE 'S2'.
ENDIF.
DATA : WRK_BSCHL LIKE BSIS-BSCHL.
CLEAR WRK_BSCHL.
IF NOT WRK_TDSWRBTR IS INITIAL.
IT_DATA-XBLNR = 'TDS/ECess'.
IT_DATA-WRBTR = WRK_TDSWRBTR.
SELECT SINGLE BSCHL INTO WRK_BSCHL FROM BSIS
WHERE BELNR = IT_BKPF-BELNR
AND GJAHR = IT_BKPF-GJAHR
AND QSSKZ NE SPACE
AND BUKRS IN S_BUKRS
AND QSSKZ NE 'XX'
AND XREF3 NE SPACE
AND QSSKZ NE 'S1'
AND QSSKZ NE 'S2'
AND BSCHL = '40'.
IF WRK_BSCHL IS INITIAL.
SELECT SINGLE BSCHL INTO WRK_BSCHL FROM BSAS
WHERE BELNR = IT_BKPF-BELNR
AND GJAHR = IT_BKPF-GJAHR
AND QSSKZ NE SPACE
AND QSSKZ NE 'XX'
AND XREF3 NE SPACE
AND BUKRS IN S_BUKRS
AND QSSKZ NE 'S1'
AND QSSKZ NE 'S2'
AND BSCHL = '40'.
ENDIF.
IF WRK_BSCHL IS INITIAL.
IT_DATA-WRBTR = IT_DATA-WRBTR * - 1.
ENDIF.
IT_DATA-WRBTRC = IT_DATA-WRBTR.
APPEND IT_DATA.
ENDIF.
IT_DATA-VBELNR = IT_BKPF-BELNR.
IT_DATA-BELNR = ' '.
IT_DATA-GJAHR = ' '.
IT_DATA-BLDAT = ' '.
IT_DATA-BLART = ' '.
IT_DATA-ZUONR = ' '.
Discount
DATA : WRK_DEDWRBTR LIKE BSIS-WRBTR.
CLEAR WRK_DEDWRBTR.
SELECT SUM( WRBTR ) INTO WRK_DEDWRBTR FROM BSIS
WHERE BELNR = IT_BKPF-BELNR
AND GJAHR = IT_BKPF-GJAHR
AND QSSKZ EQ SPACE
AND BUKRS IN S_BUKRS
AND BSCHL NE '50'.
IF NOT WRK_DEDWRBTR IS INITIAL.
SELECT SUM( WRBTR ) INTO WRK_DEDWRBTR FROM BSAS
WHERE BELNR = IT_BKPF-BELNR
AND GJAHR = IT_BKPF-GJAHR
AND QSSKZ EQ SPACE
AND BUKRS IN S_BUKRS
AND BSCHL NE '50'.
ENDIF.
IF NOT WRK_DEDWRBTR IS INITIAL.
IT_DATA-XBLNR = 'Discount'.
IT_DATA-WRBTR = WRK_DEDWRBTR.
IT_DATA-WRBTR = IT_DATA-WRBTR * - 1.
IT_DATA-WRBTRC = IT_DATA-WRBTR.
APPEND IT_DATA.
ENDIF.
Invoice
ELSE.
REFRESH IT_BELNR.
CLEAR IT_BELNR.
DATA : W_YEAR(4),
W_MONTH(2) VALUE '04',
W_DATE(2) VALUE '01',
W_YEAR1(8).
W_YEAR = S_GJAHR-LOW.
CONCATENATE W_YEAR W_MONTH W_DATE INTO W_YEAR1.
SELECT BELNR GJAHR XBLNR BLDAT BLART ZUONR WRBTR BSCHL INTO
TABLE IT_BELNR FROM BSAK
WHERE AUGBL = IT_BKPF-BELNR
AND AUGDT GE W_YEAR1
AND GJAHR = IT_BKPF-GJAHR
AND BELNR NE IT_BKPF-BELNR
AND BUKRS IN S_BUKRS.
SORT IT_BELNR BY BELNR GJAHR.
LOOP AT IT_BELNR.
CLEAR WRK_TDSWRBTR.
SELECT SUM( WRBTR ) INTO WRK_TDSWRBTR FROM BSIS
WHERE BELNR = IT_BELNR-BELNR
AND GJAHR = IT_BELNR-GJAHR
AND QSSKZ NE SPACE
AND BUKRS IN S_BUKRS
AND QSSKZ NE 'XX'.
IF WRK_TDSWRBTR IS INITIAL.
SELECT SUM( WRBTR ) INTO WRK_TDSWRBTR FROM BSAS
WHERE BELNR = IT_BELNR-BELNR
AND GJAHR = IT_BELNR-GJAHR
AND QSSKZ NE SPACE
AND BUKRS IN S_BUKRS
AND QSSKZ NE 'XX'.
ENDIF.
IT_DATA-VBELNR = IT_BKPF-BELNR.
IT_DATA-BELNR = IT_BELNR-BELNR.
IT_DATA-GJAHR = IT_BELNR-GJAHR.
IT_DATA-XBLNR = IT_BELNR-XBLNR.
IT_DATA-BLDAT = IT_BELNR-BLDAT.
IT_DATA-BLART = IT_BELNR-BLART.
IT_DATA-ZUONR = IT_BELNR-ZUONR.
IT_DATA-WRBTR = IT_BELNR-WRBTR + WRK_TDSWRBTR .
IF IT_BELNR-BSCHL GE '31' AND IT_BELNR-BSCHL LE '39'.
IT_DATA-WRBTRC = IT_DATA-WRBTR.
ELSE.
IF IT_BELNR-BSCHL GE '21' AND IT_BELNR-BSCHL LE '29'.
IT_DATA-WRBTRC = IT_DATA-WRBTR * - 1.
ENDIF.
ENDIF.
APPEND IT_DATA.
IT_DATA-VBELNR = IT_BKPF-BELNR.
IT_DATA-BELNR = ' '.
IT_DATA-GJAHR = ' '.
IT_DATA-BLDAT = ' '.
IT_DATA-BLART = ' '.
IT_DATA-ZUONR = ' '.
TDSBELNR
IF NOT WRK_TDSWRBTR IS INITIAL.
IT_DATA-XBLNR = 'TDS/ECess'.
IT_DATA-WRBTR = WRK_TDSWRBTR.
CLEAR WRK_BSCHL.
IF NOT WRK_TDSWRBTR IS INITIAL.
IT_DATA-XBLNR = 'TDS/ECess'.
IT_DATA-WRBTR = WRK_TDSWRBTR.
SELECT SINGLE BSCHL INTO WRK_BSCHL FROM BSIS
WHERE BELNR = IT_BELNR-BELNR
AND GJAHR = IT_BELNR-GJAHR
AND QSSKZ NE SPACE
AND QSSKZ NE 'XX'
AND BSCHL = '40'.
IF WRK_BSCHL IS INITIAL.
SELECT SINGLE BSCHL INTO WRK_BSCHL FROM BSAS
WHERE BELNR = IT_BELNR-BELNR
AND GJAHR = IT_BELNR-GJAHR
AND QSSKZ NE SPACE
AND QSSKZ NE 'XX'
AND BSCHL = '40'.
ENDIF.
IF WRK_BSCHL IS INITIAL.
IT_DATA-WRBTR = IT_DATA-WRBTR * - 1.
ENDIF.
IT_DATA-WRBTRC = IT_DATA-WRBTR.
APPEND IT_DATA.
ENDIF.
ENDIF.
ENDLOOP.
IT_DATA-VBELNR = IT_BKPF-BELNR.
IT_DATA-BELNR = ' '.
IT_DATA-GJAHR = ' '.
IT_DATA-BLDAT = ' '.
IT_DATA-BLART = ' '.
IT_DATA-ZUONR = ' '.
TDSVBELNR
CLEAR WRK_TDSWRBTR.
SELECT SUM( WRBTR ) INTO WRK_TDSWRBTR FROM BSIS
WHERE BELNR = IT_BKPF-BELNR
AND GJAHR = IT_BKPF-GJAHR
AND QSSKZ NE SPACE
AND BUKRS IN S_BUKRS
AND QSSKZ NE 'XX'
AND QSSKZ NE 'S1'
AND QSSKZ NE 'S2'.
IF WRK_TDSWRBTR IS INITIAL.
SELECT SUM( WRBTR ) INTO WRK_TDSWRBTR FROM BSAS
WHERE BELNR = IT_BKPF-BELNR
AND GJAHR = IT_BKPF-GJAHR
AND QSSKZ NE SPACE
AND QSSKZ NE 'XX'
AND AUGBL = SPACE
AND BUKRS IN S_BUKRS
AND QSSKZ NE 'S1'
AND QSSKZ NE 'S2'.
ENDIF.
**INSERTED BY PALANI ON 01.04.2006
IF WRK_TDSWRBTR IS INITIAL.
SELECT SUM( WRBTR ) INTO WRK_TDSWRBTR FROM BSIS
WHERE BELNR = IT_BKPF-BELNR
AND GJAHR = IT_BKPF-GJAHR.
ENDIF.
***END BY PALANI.
IF NOT WRK_TDSWRBTR IS INITIAL.
IT_DATA-XBLNR = 'TDS/ECess'.
IT_DATA-WRBTR = WRK_TDSWRBTR.
IT_DATA-WRBTR = IT_DATA-WRBTR * - 1.
IT_DATA-WRBTRC = IT_DATA-WRBTR.
APPEND IT_DATA.
ENDIF.
IT_DATA-VBELNR = IT_BKPF-BELNR.
IT_DATA-BELNR = ' '.
IT_DATA-GJAHR = ' '.
IT_DATA-BLDAT = ' '.
IT_DATA-BLART = ' '.
IT_DATA-ZUONR = ' '.
*DiscountVBELNR
CLEAR WRK_DEDWRBTR.
SELECT SUM( WSKTO ) INTO WRK_DEDWRBTR FROM BSE_CLR
WHERE BELNR_CLR = IT_BKPF-BELNR
AND GJAHR_CLR = IT_BKPF-GJAHR
AND BUKRS IN S_BUKRS.
IF NOT WRK_DEDWRBTR IS INITIAL.
IT_DATA-XBLNR = 'Discount'.
IT_DATA-WRBTR = WRK_DEDWRBTR.
IT_DATA-WRBTR = IT_DATA-WRBTR * - 1.
IT_DATA-WRBTRC = IT_DATA-WRBTR.
APPEND IT_DATA.
ENDIF.
ENDIF.
ENDLOOP.
LOOP AT IT_BKPF.
SELECT SINGLE BUTXT ORT01 LAND1 INTO (IT_DATA-BUTXT,IT_DATA-ORT01,IT_DATA-LAND1)
FROM T001
WHERE BUKRS IN S_BUKRS.
MODIFY IT_DATA INDEX SY-TABIX.
*ENDLOOP.
ENDFORM. " select_data
*& Form print_data
text
--> p1 text
<-- p2 text
FORM PRINT_DATA .
PERFORM OPEN_FORM.
PERFORM WRITE_FORM.
PERFORM CLOSE_FORM.
LEAVE LIST-PROCESSING.
ENDFORM. " print_data
*& Form open_form
text
--> p1 text
<-- p2 text
FORM OPEN_FORM .
CALL FUNCTION 'OPEN_FORM'
EXPORTING
FORM = 'ZFI_PAY_ADV_MODN'
LANGUAGE = SY-LANGU.
ENDFORM. " open_form
*& Form write_form
text
--> p1 text
<-- p2 text
FORM WRITE_FORM .
LOOP AT IT_BKPF.
IF SY-TABIX GT 1.
AT NEW BELNR.
CALL FUNCTION 'WRITE_FORM'
EXPORTING
ELEMENT = 'NEW'
WINDOW = 'MAIN'.
ENDAT.
ENDIF.
LOOP AT IT_DATA WHERE VBELNR = IT_BKPF-BELNR.
DATA : BEGIN OF IT_HKONT OCCURS 0,
HKONT LIKE BSIS-HKONT,
WRBTR LIKE BSIS-WRBTR,
END OF IT_HKONT.
REFRESH IT_HKONT.
CLEAR IT_HKONT.
SELECT HKONT WRBTR INTO TABLE IT_HKONT FROM BSIS
WHERE BELNR = IT_BKPF-BELNR
AND GJAHR = IT_BKPF-GJAHR.
DELETE IT_HKONT WHERE HKONT(3) NE '005'.
IF NOT IT_HKONT[] IS INITIAL.
LOOP AT IT_HKONT.
IT_DATA-TOTAL = IT_DATA-TOTAL + IT_HKONT-WRBTR.
MODIFY IT_DATA.
ENDLOOP.
ELSE.
IT_DATA-TOTAL = IT_DATA-TOTAL + IT_DATA-WRBTR.
MODIFY IT_DATA.
ENDIF.
ENDLOOP.
LOOP AT IT_DATA WHERE VBELNR = IT_BKPF-BELNR.
IF IT_DATA-BLART EQ ''. " for invoice Date
IT_DATA-BLDAT = IT_BKPF-BLDAT.
ENDIF.
IT_DATA-LIFNR = IT_BKPF-LIFNR.
IT_DATA-KUNNR = IT_BKPF-KUNNR.
IT_DATA-NAME1 = IT_BKPF-NAME1.
IT_DATA-NAME2 = IT_BKPF-NAME2.
IT_DATA-NAME3 = IT_BKPF-NAME3.
IT_DATA-NAME4 = IT_BKPF-NAME4.
IT_DATA-CITY1 = IT_BKPF-CITY1.
IT_DATA-REGION = IT_BKPF-REGION.
IT_DATA-COUNTRY = IT_BKPF-COUNTRY.
IT_DATA-STREET = IT_BKPF-STREET.
IT_DATA-LANDX = IT_BKPF-LANDX.
IT_DATA-BEZEI = IT_BKPF-BEZEI.
CLEAR : WRK_HBKID , WRK_BANKL.
SELECT SINGLE CHECT ZALDT HBKID INTO
(IT_DATA-CHECT , IT_DATA-ZALDT , WRK_HBKID)
FROM PAYR
WHERE VBLNR = IT_BKPF-BELNR
AND GJAHR = IT_BKPF-GJAHR
AND VOIDR = '00'.
SELECT SINGLE BANKL INTO WRK_BANKL
FROM T012
WHERE HBKID = WRK_HBKID.
AND spras EQ 'EN'.
SELECT SINGLE BANKA INTO IT_DATA-BANKA
FROM BNKA
WHERE BANKL = WRK_BANKL.
MODIFY IT_DATA.
CALL FUNCTION 'WRITE_FORM'
EXPORTING
ELEMENT = 'ITEMS'
WINDOW = 'MAIN'.
ENDLOOP.
CALL FUNCTION 'WRITE_FORM'
EXPORTING
ELEMENT = 'TOTAL'
WINDOW = 'MAIN'.
ENDLOOP.
ENDFORM. " write_form
*& Form close_form
text
--> p1 text
<-- p2 text
FORM CLOSE_FORM .
CALL FUNCTION 'CLOSE_FORM' .
ENDFORM. " close_form
Hi
Could you tell us what fields are not updated?
Regards,
Raj
Similar Messages
-
Sales document number not updated in FI document
Hi,
Whenever invoice creates in FI through billing document, system will not update sales document number in FI document(Invoice). Please confirm if there is any way to update sales document number in FI document because I want to create dunning notices on sales order basis.
Request immediate help.
Thanks in advance.Hi,
In the standard system, FI postings will be updated with FI document numbers only. If you want to see respective billing document number in customer ledger, go to FBL5N, select 'Change Layout' icon and move billing document number from 'hidden fields' to display fields list and see.
Regds
Sarma BH -
Folio number not updated in the table RG23D
Hi all,
Folio number not updated in the table RG23D when I create depot excise invoice using batch program J_1IJCHK. Can any one help me by providing rootcause and solution.
Thanks in advance.
Regards
BalajiSee can i know in which version u r working,Because if u r in 4.6c there will be some problem.Some patches will be there.
Try this program i have send and assign excise duty
REPORT YJ_1IJCHK MESSAGE-ID 8I.
TABLES : J_1IEXCHDR, "excise header
J_1IEXCDTL, "excise detail
J_1IRG23D , "RG23D register
J_1IWRKCUS, "Plant level customisation
J_1IREGSET, "register set customisation
J_1IEXCDEF, "Tax default information
VBFA, "sales document flow
LIKP, "delivery header
LIPS, "delivery detail
T005, "country information
KUAGV, "sold-to-party information
KUWEV, "ship-to-party information
KNA1, "customer master
VBPA, "sales document partner
TVKO, "sales organisation to company co
VBUK, "delivery information
MAKT, "material description
T001. "company code
selection-screen begin of block delivery_details no intervals.
PARAMETERS: FCODE TYPE C,
DELIVERY LIKE LIPS-VBELN,
EXCGROUP LIKE J_1IEXCHDR-EXGRP,
SERGROUP LIKE J_1IEXCHDR-SRGRP.
TYPES : BEGIN OF RG23D.
INCLUDE STRUCTURE J_1IRG23D.
TYPES: MENGR LIKE J_1IEXCDTL-MENGR, "remaining quantity
MENGA LIKE J_1IEXCDTL-MENGA, "quantity actually rec
ADDBED LIKE J_1IEXCDTL-ADDBED,
ADDSED LIKE J_1IEXCDTL-ADDSED,
ADDAED LIKE J_1IEXCDTL-ADDAED,
END OF RG23D.
DATA : BEGIN OF J1IJ300,
BUKRS LIKE TVKO-BUKRS,
WERKS LIKE LIPS-WERKS,
REGID LIKE J_1IREGSET-J_1IREGID,
WAERS LIKE T001-WAERS,
SHIPFROM_IND TYPE C, " Added 10/12/1998
RG23D_SERIALNO TYPE C, " Added 10/12/1998
END OF J1IJ300.
DATA : TRNTYP(4) TYPE C,
CONDT-NAME(3) TYPE C,
TOTAL_LRG23D LIKE LIPS-LFIMG,
ALLOC_LRG23D LIKE LIPS-LFIMG,
SHIPFROM_IND LIKE J_1IEXCHDR-STATUS,
RG23D_SERIALNO LIKE J_1IEXCHDR-STATUS.
DATA : BEGIN OF XLIPS OCCURS 10,
internal table to store the delivery item information
VBELN LIKE LIPS-VBELN,
POSNR LIKE LIPS-POSNR,
MATNR LIKE LIPS-MATNR,
MAKTX LIKE MAKT-MAKTX,
WERKS LIKE LIPS-WERKS,
LGORT LIKE LIPS-LGORT,
CHARG LIKE LIPS-CHARG,
LFIMG LIKE LIPS-LFIMG,
MEINS LIKE LIPS-MEINS,
BED LIKE J_1IRG23D-EXBED,
SED LIKE J_1IRG23D-EXSED,
AED LIKE J_1IRG23D-EXAED,
CUR LIKE J_1IRG23D-EXCUR,
SELFLAG TYPE C , "T=excise invoice selected
INDEX LIKE SY-TABIX, "index in the table
FLG TYPE C. "item selection
DATA : END OF XLIPS.
DATA : CRG23D TYPE RG23D OCCURS 30 WITH HEADER LINE.
contains all rg23d entries for the document
DATA : LRG23D TYPE RG23D OCCURS 30 WITH HEADER LINE.
contains item rg23d entries
DATA : BEGIN OF Z_1IRG23D OCCURS 30.
stores the data to be updated
INCLUDE STRUCTURE J_1IRG23D.
DATA : END OF Z_1IRG23D.
DATA : BEGIN OF EXCINV OCCURS 30.
factory inovoics selected for item
INCLUDE STRUCTURE J_1IEXCDTL.
DATA : END OF EXCINV.
DATA : BEGIN OF ASSIGNED_EXCINV OCCURS 30.
INCLUDE STRUCTURE J_1IEXCDTL.
DATA : END OF ASSIGNED_EXCINV.
DATA : A_INDEX LIKE SYST-TABIX.
DATA : BEGIN OF LOCK_TABLE OCCURS 10,
table containing plant-material combination and status of the lock
WERKS LIKE J_1IEXCDTL-WERKS,
MATNR LIKE J_1IEXCDTL-MATNR,
STATUS TYPE C, "LOCKED/UNLOCKED
END OF LOCK_TABLE.
DATA : BEGIN OF LOCKTAB OCCURS 0,
TRNTYP LIKE J_1IEXCDTL-TRNTYP,
DOCNO LIKE J_1IEXCDTL-DOCNO,
DOCYR LIKE J_1IEXCDTL-DOCYR,
ZEILE LIKE J_1IEXCDTL-ZEILE,
END OF LOCKTAB.
DATA :
CRG23D-CTR TYPE I, "Line count of crg23d table
SHIPFROM LIKE J_1IRG23D-SHIPFROM,
FOLIO LIKE J_1IRG23D-FOLIO,
SERIALNO LIKE J_1IRG23D-SERIALNO,
DEPEXNUM LIKE J_1IRG23D-DEPEXNUM,
DEPEXYEAR LIKE J_1IRG23D-DEPEXYEAR.
CONSTANTS :
BED LIKE CONDT-NAME VALUE 'BED',
AED LIKE CONDT-NAME VALUE 'AED',
SED LIKE CONDT-NAME VALUE 'SED',
CES LIKE CONDT-NAME VALUE 'CES',
LOCKED TYPE C VALUE '1',
UNLOCKED TYPE C VALUE '2'.
AT SELECTION-SCREEN.
PERFORM CHECK_VBELN_INPUT.
IF FCODE = 'S'.
PERFORM DELIVERY_START_USER_EXIT.
PERFORM READ_DELIVERY_HEADER.
PERFORM GET_COMP_CODE.
PERFORM READ_CUSTOMISATION.
PERFORM GET_ITEM_INFO.
PERFORM LOCKING.
PERFORM RG23D_SELECTION.
PERFORM SAVE_DOCUMENT.
MESSAGE I000 WITH 'Selection Complete for Delivery ' DELIVERY.
ELSEIF FCODE = 'V'.
PERFORM GET_COMP_CODE.
PERFORM READ_CUSTOMISATION.
PERFORM GET_ITEM_INFO.
PERFORM LOCKING.
PERFORM UPDATE_DOCUMENT.
MESSAGE I000 WITH 'Verfiy/Post Complete for Delivery ' DELIVERY.
ENDIF.
FORM CHECK_VBELN_INPUT.
Validate Function Code
IF NOT ( FCODE = 'S' OR FCODE = 'V' ).
MESSAGE E000 WITH 'Valid Functions are S/V - Select/Verify Post'.
ENDIF.
IF DELIVERY IS INITIAL.
MESSAGE E000 WITH 'Delivery number cannot be initial'.
ENDIF.
check if goods issue done for the delivery
SELECT SINGLE WBSTK INTO VBUK-WBSTK
FROM VBUK
WHERE VBELN = DELIVERY.
IF SY-SUBRC = 0.
IF VBUK-WBSTK <> 'C' AND FCODE = 'V'.
MESSAGE W339 WITH DELIVERY.
ENDIF.
ELSE.
MESSAGE E000 WITH 'Invalid Delivery'.
ENDIF.
if in select mode check if excise invoice already selected for delive
SELECT SINGLE * FROM J_1IRG23D
WHERE VBELN = DELIVERY.
IF FCODE = 'S'.
IF SY-SUBRC = 0.
MESSAGE E325 WITH DELIVERY.
ENDIF.
ELSEIF FCODE = 'V'.
IF SY-SUBRC NE 0.
MESSAGE E000 WITH 'Selection not over for ' DELIVERY.
ELSEIF J_1IRG23D-STATUS = 'P'.
MESSAGE E000 WITH 'Record Already Posted '.
ENDIF.
ENDIF.
CLEAR J_1IRG23D.
ENDFORM. " CHECK_VBELN_INPUT
FORM READ_DELIVERY_HEADER.
SELECT SINGLE * FROM LIKP
WHERE VBELN = DELIVERY.
get the sold-to-party
CLEAR: KUAGV, KUWEV.
SELECT SINGLE KUNNR NAME1 LAND1
FROM KNA1 INTO (KUAGV-KUNNR,KUAGV-NAME1,KUAGV-LAND1)
WHERE KUNNR = LIKP-KUNAG.
get the ship-to-party
SELECT SINGLE KUNNR LAND1 NAME1
FROM KNA1 INTO (KUWEV-KUNNR,KUWEV-LAND1,KUWEV-NAME1)
WHERE KUNNR = LIKP-KUNNR.
ENDFORM. " READ_DELIVERY_HEADER
FORM GET_COMP_CODE.
get the company code of the document from the sales organisation
CLEAR TVKO-BUKRS.
SELECT SINGLE BUKRS FROM TVKO INTO TVKO-BUKRS
WHERE VKORG = LIKP-VKORG.
J1IJ300-BUKRS = TVKO-BUKRS.
SELECT SINGLE WAERS FROM T001 INTO J1IJ300-WAERS
WHERE BUKRS = J1IJ300-BUKRS.
ENDFORM. " GET_COMP_CODE
FORM READ_CUSTOMISATION.
SELECT SINGLE WERKS INTO J1IJ300-WERKS
FROM LIPS
WHERE VBELN = DELIVERY.
Plant level customisation
SELECT SINGLE * FROM J_1IWRKCUS
WHERE J_1IWERKS = J1IJ300-WERKS .
IF SY-SUBRC <> 0.
MESSAGE E303 WITH 'plant' J1IJ300-WERKS 'J_1IWRKCUS'.
ENDIF.
IF J_1IWRKCUS-J_1IDEPOT IS INITIAL.
plant is defined as factory
MESSAGE E322 WITH J1IJ300-WERKS.
ENDIF.
J1IJ300-REGID = J_1IWRKCUS-J_1IREGID.
TRNTYP = 'DLDO'.
SELECT SINGLE * FROM J_1IREGSET
WHERE J_1IREGID = J1IJ300-REGID.
IF SY-SUBRC <> 0.
MESSAGE E303 WITH 'Register id' J1IJ300-REGID 'J_1IREGSET'.
ENDIF.
ENDFORM. " READ_CUSTOMISATION
*& Form GET_ITEM_INFO
text *
--> p1 text
<-- p2 text
FORM GET_ITEM_INFO.
REFRESH : CRG23D, LRG23D, EXCINV, XLIPS.
PERFORM READ_DELIVERY_ITEM.
ENDFORM. " GET_ITEM_INFO
*& Form READ_DELIVERY_ITEM
text *
--> p1 text
<-- p2 text
FORM READ_DELIVERY_ITEM.
DATA : CNT LIKE SY-TABIX.
CLEAR CNT.
REFRESH XLIPS.
SELECT * FROM LIPS
WHERE VBELN = DELIVERY.
read the delivery item
perform plant checking only if in create mode
IF LIPS-WERKS <> J1IJ300-WERKS.
plant is different from that of the first item
SELECT SINGLE J_1IREGID INTO J_1IWRKCUS-J_1IREGID
FROM J_1IWRKCUS
WHERE J_1IWERKS = LIPS-WERKS.
IF SY-SUBRC <> 0.
MESSAGE E303 WITH 'plant' LIPS-WERKS 'J_1IWRKCUS'.
ENDIF.
IF J_1IWRKCUS-J_1IREGID <> J1IJ300-REGID.
register id of the two plants are different
MESSAGE E338 WITH DELIVERY.
ENDIF.
ENDIF.
CLEAR XLIPS.
store the item details
XLIPS-VBELN = LIPS-VBELN.
XLIPS-POSNR = LIPS-POSNR.
XLIPS-MATNR = LIPS-MATNR.
PERFORM GET_MATERIAL_DESC
USING XLIPS-MATNR
XLIPS-MAKTX.
XLIPS-WERKS = LIPS-WERKS.
XLIPS-LGORT = LIPS-LGORT.
XLIPS-CHARG = LIPS-CHARG.
XLIPS-LFIMG = LIPS-LFIMG.
XLIPS-MEINS = LIPS-VRKME. "changed 2.3.98
CLEAR : XLIPS-BED, XLIPS-SED, XLIPS-AED.
XLIPS-CUR = J1IJ300-BUKRS.
CNT = CNT + 1.
XLIPS-INDEX = CNT.
XLIPS-SELFLAG = 'F'.
APPEND XLIPS.
ENDSELECT.
ENDFORM. " READ_DELIVERY_ITEM
*& Form GET_MATERIAL_DESC
text *
--> p1 text
<-- p2 text
FORM GET_MATERIAL_DESC USING MATNR MAKTX.
SELECT SINGLE MAKTX FROM MAKT INTO MAKTX
WHERE MATNR = MATNR
AND SPRAS = 'E' .
ENDFORM. " GET_MATERIAL_DESC
*& Form LOCKING
text *
--> p1 text
<-- p2 text
FORM LOCKING.
REFRESH LOCK_TABLE.
LOOP AT XLIPS.
LOCK_TABLE-WERKS = XLIPS-WERKS.
LOCK_TABLE-MATNR = XLIPS-MATNR.
LOCK_TABLE-STATUS = UNLOCKED.
COLLECT LOCK_TABLE.
ENDLOOP.
PERFORM LOCK_UNLOCK_PLANT_MATERIAL USING LOCKED.
SELECT TRNTYP DOCNO DOCYR ZEILE INTO
(LOCKTAB-TRNTYP,
LOCKTAB-DOCNO,LOCKTAB-DOCYR,
LOCKTAB-ZEILE)
FROM J_1IEXCDTL
WHERE TRNTYP = 'GRPO'
AND WERKS = XLIPS-WERKS
AND LGORT = XLIPS-LGORT
AND MATNR = XLIPS-MATNR
AND CHARG = XLIPS-CHARG.
APPEND LOCKTAB.
ENDSELECT.
*share lock for all excise invoices
LOOP AT LOCKTAB.
CALL FUNCTION 'ENQUEUE_EJ_1IEXDTL'
EXPORTING
MODE_J_1IEXCDTL = 'S'
MANDT = SY-MANDT
TRNTYP = LOCKTAB-TRNTYP
DOCYR = LOCKTAB-DOCYR
DOCNO = LOCKTAB-DOCNO
ZEILE = LOCKTAB-ZEILE
EXCEPTIONS
FOREIGN_LOCK = 1
SYSTEM_FAILURE = 2
OTHERS = 3.
ENDLOOP.
ENDFORM. " LOCKING
*& Form LOCK_UNLOCK_PLANT_MATERIAL
text *
--> p1 text
<-- p2 text
FORM LOCK_UNLOCK_PLANT_MATERIAL USING ACTION.
DATA: __UNAME LIKE SY-UNAME,
__OBJECT LIKE DD25V-VIEWNAME.
DATA : BEGIN OF LOCK_STRUCT,
GRANNAME(10) VALUE 'J1IJ',
ENQMODE VALUE 'E',
MANDT LIKE SY-MANDT,
WERKS LIKE J_1IEXCDTL-WERKS,
MATNR LIKE J_1IEXCDTL-MATNR,
END OF LOCK_STRUCT.
LOCK_STRUCT-MANDT = SY-MANDT.
LOOP AT LOCK_TABLE WHERE STATUS <> ACTION.
perform the locking/unlocking operation only for the items for which
it is not already done
LOCK_STRUCT-WERKS = LOCK_TABLE-WERKS.
LOCK_STRUCT-MATNR = LOCK_TABLE-MATNR.
CALL 'C_ENQUEUE'
ID 'OPCODE' FIELD ACTION
ID 'ENQOBJ' FIELD 'J_1IJ'
ID '01' FIELD LOCK_STRUCT
ID 'COLLISION_UNAME' FIELD __UNAME
ID 'COLLISION_OBJECT' FIELD __OBJECT.
CASE SY-SUBRC.
WHEN 0.
LOCK_TABLE-STATUS = ACTION.
MODIFY LOCK_TABLE.
WHEN 2.
MESSAGE E341 WITH LOCK_TABLE-WERKS LOCK_TABLE-MATNR __UNAME.
WHEN OTHERS.
IF ACTION = LOCKED.
MESSAGE E342 WITH 'locking'
LOCK_TABLE-WERKS LOCK_TABLE-MATNR.
ELSE.
MESSAGE E342 WITH 'unlocking'
LOCK_TABLE-WERKS LOCK_TABLE-MATNR.
ENDIF.
ENDCASE.
ENDLOOP.
ENDFORM. " LOCK_UNLOCK_PLANT_MATERIAL
*& Form RG23D_SELECTION
text *
--> p1 text
<-- p2 text
FORM RG23D_SELECTION.
REFRESH CRG23D.
REFRESH ASSIGNED_EXCINV.
LOOP AT XLIPS.
*write: / xlips-vbeln,xlips-posnr,xlips-matnr, xlips-meins, xlips-lfimg.
REFRESH EXCINV.
CALL FUNCTION 'J_1I6_SELECT_EXCISE_INVOICE_DE'
EXPORTING
BUKRS = J1IJ300-BUKRS
CHARG = XLIPS-CHARG
WERKS = XLIPS-WERKS
EXGRP = EXCGROUP
MATNR = XLIPS-MATNR
QTY_CHECK = 'X'
MULTI = 'X'
NO_DAY_CHECK = 'X'
SHIPFROM = SHIPFROM
LGORT = XLIPS-LGORT
TABLES
EXC_TAB = EXCINV
EXCEPTIONS
OTHERS = 1.
TOTAL_LRG23D = 0.
ALLOC_LRG23D = 0.
SORT EXCINV BY DOCYR DOCNO .
LOOP AT ASSIGNED_EXCINV.
READ TABLE EXCINV WITH KEY DOCYR = ASSIGNED_EXCINV-DOCYR
DOCNO = ASSIGNED_EXCINV-DOCNO
ZEILE = ASSIGNED_EXCINV-ZEILE
BINARY SEARCH.
IF SY-SUBRC = 0.
A_INDEX = SY-TABIX.
EXCINV-MENGR = EXCINV-MENGR - ASSIGNED_EXCINV-MENGR.
MODIFY EXCINV INDEX A_INDEX .
ENDIF.
ENDLOOP.
DELETE EXCINV WHERE MENGR = 0.
total_lrg23d = total balance quantity in the selected excise invoices
alloc_lrg23d = Quantity allocated to a delivery line item,
Allocation continues till
- We have balance quantity in excise invoice selection
- Till total delivery quantity is allocated
LOOP AT EXCINV.
To Force the same shipfrom for all the excise invoices
Shipfrom Ind can be determined in the start user-exit
IF J1IJ300-SHIPFROM_IND = 'Y'.
IF XLIPS-INDEX = 1 AND SY-TABIX = 1.
SHIPFROM = EXCINV-SHIPFROM.
ENDIF.
IF SHIPFROM NE EXCINV-SHIPFROM.
EXCINV-RIND3 = 'X'.
MODIFY EXCINV.
CONTINUE.
ENDIF.
ENDIF.
Allocation
IF XLIPS-LFIMG NE ALLOC_LRG23D.
TOTAL_LRG23D = TOTAL_LRG23D + EXCINV-MENGR.
IF XLIPS-LFIMG > TOTAL_LRG23D.
ALLOC_LRG23D = ALLOC_LRG23D + EXCINV-MENGR.
ELSE.
EXCINV-MENGR = XLIPS-LFIMG - ALLOC_LRG23D.
ALLOC_LRG23D = ALLOC_LRG23D + EXCINV-MENGR.
ENDIF.
ELSE.
EXCINV-RIND3 = 'X'.
ENDIF.
MODIFY EXCINV.
ENDLOOP.
DELETE EXCINV WHERE RIND3 = 'X'.
LOOP AT EXCINV.
MOVE-CORRESPONDING EXCINV TO ASSIGNED_EXCINV.
APPEND ASSIGNED_EXCINV.
CLEAR ASSIGNED_EXCINV.
ENDLOOP.
IF TOTAL_LRG23D < XLIPS-LFIMG.
MESSAGE E000 WITH 'Not enough balance in RG23D ......'.
ENDIF.
Collect all allocated excise invoices to crg23d table
LOOP AT EXCINV.
PERFORM FILL_CRG23D.
APPEND CRG23D.
ENDLOOP.
ENDLOOP.
ENDFORM. " RG23D_SELECTION
*& Form SAVE_DOCUMENT
text *
--> p1 text
<-- p2 text
FORM SAVE_DOCUMENT.
PERFORM PREPARE_RG23D_DATA.
Generate RG23D serial number and Excise Invoice Serial Number
IF J1IJ300-RG23D_SERIALNO = 'Y'.
PERFORM GENERATE_RG23D_SERIAL ON COMMIT.
ENDIF.
PERFORM GENERATE_EXCISE_INV_SERIAL ON COMMIT.
CALL FUNCTION 'J_1I7_USEREXIT_DEPOT_BEF_SAVE'
TABLES
RG23D = Z_1IRG23D
EXCEPTIONS
OTHERS = 1.
PERFORM UPDATE_RG23D ON COMMIT.
PERFORM UPDATE_EXCDTL ON COMMIT.
COMMIT WORK.
PERFORM LOCK_UNLOCK_PLANT_MATERIAL USING UNLOCKED.
PERFORM UNLOCKING.
MESSAGE S333 WITH DELIVERY.
ENDFORM. " SAVE_DOCUMENT
*& Form PREPARE_RG23D_DATA
text *
--> p1 text
<-- p2 text
FORM PREPARE_RG23D_DATA.
REFRESH Z_1IRG23D.
LOOP AT CRG23D WHERE MENGE <> 0.
CLEAR Z_1IRG23D.
Z_1IRG23D = CRG23D.
Z_1IRG23D-USNAM = SY-UNAME.
Z_1IRG23D-CPUDT = SY-DATUM.
Z_1IRG23D-EXGRP = EXCGROUP.
Z_1IRG23D-SRGRP = SERGROUP.
APPEND Z_1IRG23D.
IF CRG23D-ADDAED <> 0 OR CRG23D-ADDSED <> 0 OR CRG23D-ADDAED <> 0 .
additional excise is applicable
make quantity zero for A certificate entries
CLEAR : Z_1IRG23D-MENGE.
get all the A certificates for the excise document item
SELECT * FROM J_1IEXCDTL
TODO : add the transaction type to the selection procedure
WHERE RDOC1 = CRG23D-DOCNO
AND RYEAR1 = CRG23D-DOCYR
AND RITEM1 = CRG23D-ZEILE
AND RIND1 = 'G'.
get the A certificate number
SELECT SINGLE
EXNUM EXYEAR INTO (Z_1IRG23D-EXNUM, Z_1IRG23D-EXYEAR)
FROM J_1IEXCHDR
WHERE TRNTYP = J_1IEXCDTL-TRNTYP
AND DOCYR = J_1IEXCDTL-DOCYR
AND DOCNO = J_1IEXCDTL-DOCNO.
Z_1IRG23D-TRNTYP = J_1IEXCDTL-TRNTYP.
Z_1IRG23D-DOCYR = J_1IEXCDTL-DOCYR.
Z_1IRG23D-DOCNO = J_1IEXCDTL-DOCNO.
Z_1IRG23D-ZEILE = J_1IEXCDTL-ZEILE.
Z_1IRG23D-EXBED = ( J_1IEXCDTL-EXBED * CRG23D-MENGE )
/ CRG23D-MENGA.
Z_1IRG23D-EXSED = ( J_1IEXCDTL-EXSED * CRG23D-MENGE )
/ CRG23D-MENGA.
Z_1IRG23D-EXAED = ( J_1IEXCDTL-EXAED * CRG23D-MENGE )
/ CRG23D-MENGA.
Z_1IRG23D-RG23ASER = J_1IEXCDTL-RG23ASER.
Z_1IRG23D-RG23CSER = J_1IEXCDTL-RG23CSER.
Z_1IRG23D-RGPLASER = J_1IEXCDTL-RGPLASER.
APPEND Z_1IRG23D.
ENDSELECT.
ENDIF.
ENDLOOP.
ENDFORM. " PREPARE_RG23D_DATA
*& Form UPDATE_RG23D
text *
--> p1 text
<-- p2 text
FORM UPDATE_RG23D.
*update the rg23d register
INSERT J_1IRG23D FROM TABLE Z_1IRG23D ACCEPTING DUPLICATE KEYS.
IF SY-SUBRC <> 0.
MESSAGE A308 WITH 'J_1IRG23D'.
ENDIF.
ENDFORM. " UPDATE_RG23D
*& Form UPDATE_EXCDTL
text *
--> p1 text
<-- p2 text
FORM UPDATE_EXCDTL.
LOOP AT CRG23D WHERE MENGE <> 0.
update the remaining quantity in the excise invoice item tables
UPDATE J_1IEXCDTL
SET MENGR = MENGR - CRG23D-MENGE
AENAM = SY-UNAME
AEDAT = SY-DATUM
WHERE TRNTYP = 'GRPO'
AND DOCYR = CRG23D-DOCYR
AND DOCNO = CRG23D-DOCNO
AND ZEILE = CRG23D-ZEILE.
IF SY-SUBRC <> 0.
MESSAGE A308 WITH 'J_1IRG23D'.
ENDIF.
ENDLOOP.
ENDFORM. " UPDATE_EXCDTL
*& Form FILL_CRG23D
text *
--> p1 text
<-- p2 text
FORM FILL_CRG23D.
CRG23D-TRNTYP = EXCINV-TRNTYP.
CRG23D-DOCYR = EXCINV-DOCYR.
CRG23D-DOCNO = EXCINV-DOCNO.
CRG23D-ZEILE = EXCINV-ZEILE.
CRG23D-VBELN = XLIPS-VBELN.
CRG23D-POSNR = XLIPS-POSNR.
CRG23D-EXNUM = EXCINV-EXNUM.
CRG23D-EXYEAR = EXCINV-EXYEAR.
CRG23D-LIFNR = EXCINV-LIFNR.
CRG23D-MATNR = EXCINV-MATNR.
CRG23D-MAKTX = EXCINV-MAKTX.
CRG23D-CHAPID = EXCINV-CHAPID.
CRG23D-MEINS = EXCINV-MENGR_UOM.
CRG23D-WERKS = EXCINV-WERKS.
CRG23D-EXCUR = EXCINV-EXCUR.
CRG23D-RG23ASER = EXCINV-RG23ASER.
CRG23D-RG23CSER = EXCINV-RG23CSER.
CRG23D-RGPLASER = EXCINV-RGPLASER.
CRG23D-MENGR = EXCINV-MENGR.
CRG23D-MENGA = EXCINV-MENGA.
CRG23D-MENGE = EXCINV-MENGR. " Move the allocated Qty
CRG23D-EXBED = ( EXCINV-EXBED * CRG23D-MENGE ) / EXCINV-MENGA.
CRG23D-EXSED = ( EXCINV-EXSED * CRG23D-MENGE ) / EXCINV-MENGA.
CRG23D-EXAED = ( EXCINV-EXAED * CRG23D-MENGE ) / EXCINV-MENGA.
ENDFORM. " FILL_CRG23D
*& Form UPDATE_DOCUMENT
text *
--> p1 text
<-- p2 text
FORM UPDATE_DOCUMENT.
LOOP AT XLIPS.
UPDATE J_1IRG23D SET STATUS = 'P'
WHERE VBELN = XLIPS-VBELN
AND POSNR = XLIPS-POSNR.
ENDLOOP.
COMMIT WORK.
ENDFORM. " UPDATE_DOCUMENT
*& Form DELIVERY_START_USER_EXIT
text *
--> p1 text
<-- p2 text
FORM DELIVERY_START_USER_EXIT.
CALL FUNCTION 'J_1I7_USEREXIT_EXGRP_DETERM'
EXPORTING
EXCGRP = EXCGROUP
MBLNR =
MJAHR =
VENDOR =
VBELN = DELIVERY
IMPORTING
EXCGRP = EXCGROUP
SHIPFROM_IND = J1IJ300-SHIPFROM_IND
RG23D_SERIALNO = J1IJ300-RG23D_SERIALNO
EXCEPTIONS
OTHERS = 1.
CALL FUNCTION 'J_1I7_USEREXIT_SERGRP_DETERM'
EXPORTING
SRGRP = SERGROUP
MBLNR =
MJAHR =
VBELN = DELIVERY
IMPORTING
SRGRP = SERGROUP
EXCEPTIONS
OTHERS = 1.
ENDFORM. " DELIVERY_START_USER_EXIT
*& Form GENERATE_RG23D_SERIAL
text *
--> p1 text
<-- p2 text
FORM GENERATE_RG23D_SERIAL.
LOOP AT Z_1IRG23D WHERE MENGE <> 0.
CLEAR: FOLIO, SERIALNO.
SELECT MAX( FOLIO ) MAX( SERIALNO )
INTO (Z_1IRG23D-FOLIO, Z_1IRG23D-SERIALNO)
FROM J_1IRG23D
WHERE TRNTYP = Z_1IRG23D-TRNTYP
AND DOCNO = Z_1IRG23D-DOCNO
AND DOCYR = Z_1IRG23D-DOCYR
AND ZEILE = Z_1IRG23D-ZEILE.
MODIFY Z_1IRG23D.
ENDLOOP.
ENDFORM. " GENERATE_RG23D_SERIAL
*& Form GENERATE_EXCISE_INV_SERIAL
text *
--> p1 text
<-- p2 text
FORM GENERATE_EXCISE_INV_SERIAL.
CLEAR: DEPEXNUM, DEPEXYEAR.
CALL FUNCTION 'J_1I6_DETERMINE_EXC_YEAR'
EXPORTING
I_BUKRS = J1IJ300-BUKRS
IMPORTING
EXCISE_YEAR = DEPEXYEAR
EXCEPTIONS
MISS_COMPANY = 1
OTHERS = 2.
IF SY-SUBRC NE 0.
MESSAGE E526 WITH 'Company ' J1IJ300-BUKRS.
ENDIF.
CALL FUNCTION 'NUMBER_GET_NEXT'
EXPORTING
NR_RANGE_NR = '01'
OBJECT = 'J_1IDEPINV'
QUANTITY = '1'
SUBOBJECT = SERGROUP
TOYEAR = DEPEXYEAR
IMPORTING
NUMBER = DEPEXNUM
EXCEPTIONS
INTERVAL_NOT_FOUND = 1
NUMBER_RANGE_NOT_INTERN = 2
OBJECT_NOT_FOUND = 3
QUANTITY_IS_0 = 4
QUANTITY_IS_NOT_1 = 5
INTERVAL_OVERFLOW = 6
OTHERS = 7.
CASE SY-SUBRC.
WHEN 0.
WHEN 1.
MESSAGE A336 WITH 'internal document' ': Interval not found'
'. Number object : J_1IDEPINV'.
WHEN 3.
MESSAGE A336 WITH 'internal document' ': Object not found'
'. Number object : J_1IDEPINV'.
WHEN OTHERS.
MESSAGE A336 WITH 'internal document'
'. Number object : J_1IDEPINV'.
ENDCASE.
Update Depot Excise Invoice Year and Number in the table
LOOP AT Z_1IRG23D.
Z_1IRG23D-SERIALNO = Z_1IRG23D-SERIALNO + 1.
Z_1IRG23D-DEPEXYEAR = DEPEXYEAR.
Z_1IRG23D-DEPEXNUM = DEPEXNUM.
MODIFY Z_1IRG23D.
ENDLOOP.
ENDFORM. " GENERATE_EXCISE_INV_SERIAL
*& Form UNLOCKING
text
--> p1 text
<-- p2 text
FORM UNLOCKING.
LOOP AT LOCKTAB.
CALL FUNCTION 'DEQUEUE_EJ_1IEXDTL'
EXPORTING
MODE_J_1IEXCDTL = 'S'
MANDT = SY-MANDT
TRNTYP = LOCKTAB-TRNTYP
DOCYR = LOCKTAB-DOCYR
DOCNO = LOCKTAB-DOCNO
ZEILE = LOCKTAB-ZEILE.
ENDLOOP.
ENDFORM. " UNLOCKING -
Check number not updated in the payment Document
Hi,
In transaction code F110, we have created one proposal and do the payment run, System is creating the payment document but the check number not getting updated in the document.
Kindly revert back.
Thanks,
Samir BhattGo to transaction SE38 and run program RFCHKU00. This will update the assignment field of the document with the check numbers.
-
Document year not updated at the time of part I Posting
Dear Guys.,
At the time of part I posting the document yaer not updated properly. this is not upodated in some times or some cases only . but it is updating correctly other times...
but i dont know the reason why this document year was not updated.
the field name and table tane is J_1iexchdr- DOCYR.
Excise Transaction type is GRPO.
because of this problem we can not able to do the invoice verification..
REgards
P.Anandhakumar.
Edited by: Anandhakumar Palanisamy on Sep 3, 2009 8:47 AMTiming
I am not sure what is going on behind the scenes with this web site in the past few days. One day I could not post in your thread at all. Another day
I was receiving Inbox email notifications that were never posted in the Adobe Premiere Elements Forum or were posted several hours after I saw them
in my Inbox email notifications. I was waiting for the problem to disappear on its own. If not, we can post in the Adobe Comments Forum to find out what
might be going on.
https://forums.adobe.com/community/general/forum_comments
Yours has not been the only thread where I have had these problems.
ATR -
Originating document number not updated for one invoice line item
Hi,
We have a invoice document number in which the originating document number is not updated for one of the line items ,this is order related down payment invoice .May be this is due to system inconsistency so is there any SAP note to overcome this problem.
Best Regards,
RohitDear All,
I found out the problem for not updated in F-04. "While create the receipt document in GL master Open item management maintained box was not checked". It can be found in BSIS table - OI Management'.
Is there any other way to clear this document.
Thanks... -
The document could not be read: the document does not have a valid format.
I created a 10MB document in Pages about a week ago. Around that time, I reopened the document and edited it with no problems. A week later, I've tried to open the document but Pages gives me the following error:
The document "[Document Name].pages" could not be read. The document does not have a valid format.
I created, edited, and saved this document in Pages, so I am confused as to why Pages would be unable to re-open the file, especially as I haven't done anything to it since it worked last. I was worried that my hard drive might have corrupted the file so I ran diagnostic tests but everything was fine. I was also worried that because the file is synced with my iDisk that iDisk corrupted the file while syncing it or something but I don't know what I could do to check this. Either way, it's an important file and I need to open it: I thought that by putting it on iDisk I would have a copy in case something happened to my computer but this seems not to have helped (and maybe hurt!).
Any file recovery tools or other ways that I can open this file?No, I don’t have Pages ’08 installed, but did in the past—is this a current issue?
Pages ’09 is registered.
I have tried dragging the file onto the app icon directly.
To recover at least the text, I did the “rename as zip, open index.xml” trick. Of course, in order to interpret that file, you do have to understand XML (thank god I do)… but if I hadn’t, man that would’ve been a major bummer. -
Serial Number not updating in the system
Hi Frnds
My client is in to retail and has most of the materials under variant configuration. The materials are sold with serial numbers so that they can be tracked and returns/maintenance can be accounted for. The customer is also given discount if he buys that material again using the serial number as reference and the dependency written for that material updates the old purchase qty(old factor) when new purchase qty(new factor) is added to it.
Since the serial number can only be referenced once the goods has been posted and billing has been done. The factors get updated in the system, the factors were updating correctly for the past 2+yrs but since the last couple of months the updating of serial number old factor is screwed. It is not updating for some serial numbers.
Any bright ideas what may be the issue. I have searched every nook and corner but could not trace the cause. Is it possible that a particular serial number can update for a certain number or memory or something???Sorry, but the problem is not solved: it shows the same, 10 numbers and three points.
Seeing the espana2004 message, maybe it is related to the use of a proportional font? All the characters in my Pre's serial number are wide.
This number is needed to download WebOS Doctor. I've had to put my phone in developer mode, connect through novaterm and do a 'lunaprop com.palm.properties.PalmSN' in order to obtain the number. Is there an easier way to get it?
Regards. -
SO document flow not updated with PR no created
Hi All,
A Purchase Requisitions is created from SO for a line item, i can see the PR generated in report ME5A but not in document flow. Is it a standard behavior or i'm missing something ??
Regards
AbhilashPurchase requisitions are not updated in the document flow, just use SE16 and look at document flow table VBFA. it has 2 fields for document category VBTYP_V and VBTYP_N . If you use F4 on this field then you can see that the PR is not among the possible documents.
Use the status overview button instead and you can see the PR -
Internal number ranges for accounting documents are not updating
Dear Experts,
We are existing user of SAP 4.6 C , are facing probelm while posting accounting document , the accounting document number ranges are not getting updated.
When I post first document it got alloted first number from the interval when i post another document the system showing message Document Number XXXXXXX is already assigned to other document.
And we have checked through T.C FBN1 and checked the number ranges where first document didn't showing in the alloted number range status.
Early reply can be highly appreciated.
thanking you.
Regards,
Y.Kiran Babu.hi Rajesh,
check if any document exists with that number in table BKPF. Also check: the number (current number) you see in FBN1 should be the highest existing document number in BKPF (inside the range).
ec -
Documents that are park in FBV0 do not update with the new user name when
Hi,
I need to find out why documents that are park in FBV0 do not update with the new user name when any changes are made. Also when we park using MIR7 and make changes to the documents at a later time the document updates with the new users name.
Requesting you to please suggest what could be the reason.
Earliest reply will be highly appreciated,
With regards,
RjHi,
I have checked this in system. I posted one Parked invoice using T.code FV60 and there i appeared my name because i created. But after some time one of my collegue changed the reference and text field with his login i.d. But still in the invoice it is showing as my name whereas if we go to the environmnet, there in the changes we can see what are the changes done and it is appearing my collegues user i.d. But in the main invoice it is still appearing my name.
Regards,
Rj. -
Clearing document no. not updated in GRIR account
Hello all.
We recently found that there are some errors in clearing for GR/IR.
I have taken two examples as below;
- The GR 5002308346 appears in our download even though that GR has been already used to post invoices.
The Doc 5101039178, a line item is still open of amount 115.89 EUR even though that doc is cleared.
In both cases the clearing doc no. is not updated in the GRIR account line item.
Points will be awarded
regards
jayaHi,
Is automatic clearing executed and it has cleared them? Is it displaying as open item or closed item in line item display - FBL3N.
If the document is already cleared and clearing document number is not updated, check for OSS notes.
Thanks
Murali. -
Document Flow not updated in CRM from ECC
Hi Experts,
We are having a scenario where we are creating Service Orders in CRM, which in turn creates a meterial reservation document in ECC for the spare part items. However, the material reservation number is not getting updated in the document flow of the service order in CRM. We are using CRM7.0. Any suggestions anyone?Hi,
Do we need to make any MW settings for the document flow to be updated with the material reservation document created in ECC.
Rgds,
-Sweta -
SC Item in Transfer process active - follow on document status not updated
Hi Gurus,
Follow on document is not updated in SRM after PO creation. Ours is classic scenario (SRM 5.5, ECC6.0) and passed thru the following steps - SC (FFT) created, document approved, sent to SoCo, purchaser assigned vendor and created PO, PO created in ECC.
In SRM SoCo screen displays message 'PO created 45xxxxxxxxxx' successfully. Checked the BE PO 45xxxxxxx that was created successfully.
Ran BBP_GET_STATUS_2 and CLEAN_REQREQ_UP jobs. jobs finished successfully. But status is not updated in SRM. RZ20/SLG1 does not have any errors.
BBP_PD shows following statuses:
I105 Awaiting Approval X
I1021 Created
I1038 Complete
I1106 SC ordered
I1129 Approved
I1111 Item in Transfer process
The last status I1111 is still active.
Any advise are welcome. Not sure if I am missing any OSS Notes.
Regards
Viktor PaulHi,
1. Check in table BBP_DOCUMENT_TAB if the entry exists use CLEAN_REQREQ_UP program.
2. If entry in the table not exists then check in transaction BBP_PD if the follow on document ( PO ) Number reserved for
the SC .. then use FM BBP_PD_SC_RESUBMIT.
3. none of these use normal process execute BBP_REQREQ_TRANSFER And then use CLEAN_REQREQ_UP
Thanks,
prasad.s -
Invoice number and document number not printed in payment advice
Hello Gurus,
I am executing reprint check through transaction fch7, In that Invoice number and document number not printed in payment advice. I have created zscript for that and also assinged regup-belnr and regup-xblnr and used standard program RFFOUS_C.
other fields from regup table are displayed but above two mentioned fields are not displayed.
I even tried debugging standard RFFOUS_C prog, in that regup-belnr and regup-xblnr are coming but it is not printed on form.
With regards,
VikramHi,
Debug you Zscript and check the invoice no and document no. Have assigned that script in FBZP..? check the which form is calling FCH7 in debugger mode..?
Rgds
Aeda.
Maybe you are looking for
-
I have a new IPhone 6 just went to the store last Saturday to connect it, (I am replacing my IPhone 5s) it says that I am updated on IOS 8.0.2 but now started to show a message that reads like this: " No SIM card installed" and I have no phone line o
-
What's ObjectId in Crystal Report 2008 for SAP B1 8.8
Hi all! I am using Crystal Report 2008 for SAP B1 8.8, i don't know ObjectID use for what. In some report temlate of Crystal Report 2008 for SAP B1 8.8, i saw they aways use this. Please explain for me.!! Thanks!
-
Having problems changing my verizon prepaid to a new device
I'm having problems changing my Verizon prepaid phone number to a new device.
-
....and neither can any of my clients! ALL of the documents on my website are PDF format. My clients print from this website on a daily basis. I am not going to ask 300+ clients to "workaround". When will you fix?
-
Info Needed. Urgent!
Hello, I need some urgent info regarding iFS. 1- Does Oracle iFS supports multi master replication? 2- Can iFS Operations can participate in regular Db transaction? 3- Does iFS maintain ACID properties? 4- Does iFS support online Hotbackup? 5- Do u k