Go on link..

link us with ...

Thursday, December 30, 2010

Report for tracking of advance licenses


REPORT ZVVF_MR018_ADVLIC .
*---------------------------------------------------------------------*
* Report ZVVF_MR018_ADVLIC *
*---------------------------------------------------------------------*
* *
* MODULE : Material Management *
* *
*---------------------------------------------------------------------*
* Objective : Report for tracking of advance licenses *
* *
* Program : Update Tables( ) Download Data( ) Outputs List (X) *
* *
* Technical Specs No : *
* *
* Date Created : *
* *
* Author : *
* *
* Location : *
* *
* LDB : *
*---------------------------------------------------------------------*

*----------------------------------------------------------------------*
* Type-pools
*----------------------------------------------------------------------*

TYPE-POOLS : slis.


*---------------------------------------------------------------------*
* Tables *
*---------------------------------------------------------------------*
tables : ekko,
ekpo,
mseg,
lfa1,
mara,
makt,
zvvf_mt018_advli.

*----------------------------------------------------------------------*
*Types *
*----------------------------------------------------------------------*
types : begin of ty_data,
LICENSENO type zvvf_mt018_advli-LICENSENO,
MATNR type zvvf_mt018_advli-MATNR,
VALIDFROM type zvvf_mt018_advli-VALIDFROM,
VALIDto type zvvf_mt018_advli-VALIDto,
QTYALLOWED type zvvf_mt018_advli-QTYALLOWED,
MEINS TYPE zvvf_mt018_advli-MEINS,
QTYRESTRICTED type zvvf_mt018_advli-QTYRESTRICTED,
QTYRESERVED type zvvf_mt018_advli-QTYRESERVED,
LICENSEVALUE type zvvf_mt018_advli-LICENSEVALUE,
WAERS TYPE zvvf_mt018_advli-WAERS,
EXCHANGERATE TYPE zvvf_mt018_advli-EXCHANGERATE,
LICENSEVALIN TYPE zvvf_mt018_advli-LICENSEVALIN,
ebeln type ekko-ebeln,
aedat type ekko-aedat,
lifnr type ekko-lifnr,
KNUMV TYPE EKKO-KNUMV,
name1 type lfa1-name1,
ebelp type ekpo-ebelp,
MATNR1 TYPE EKPO-MATNR,
maktx type makt-maktx,
menge1 type ekpo-menge,
RATE TYPE EKPO-NETPR,
MENGE TYPE MSEG-MENGE,
GRVALUE TYPE P DECIMALS 3,
end of ty_data.

TYPES : BEGIN OF TY_MSEG,
EBELN LIKE MSEG-EBELN,
EBELP LIKE MSEG-EBELP,
MENGE LIKE MSEG-MENGE,
END OF TY_MSEG.

TYPES : BEGIN OF TY_EKPO,
EBELN LIKE EKPO-EBELN,
EBELP LIKE EKPO-EBELP,
MATNR LIKE EKPO-MATNR,
MENGE LIKE EKPO-MENGE,
END OF TY_EKPO.

types : begin of ty_lfa1,
lifnr like lfa1-lifnr,
name1 like lfa1-name1,
end of ty_lfa1.

TYPES : BEGIN OF TY_MAKT,
MATNR LIKE MAKT-MATNR,
MAKTX LIKE MAKT-MAKTX,
END OF TY_MAKT.

TYPES : BEGIN OF TY_KONV,
KNUMV LIKE KONV-KNUMV,
KPOSN LIKE KONV-KPOSN,
KBETR LIKE KONV-KBETR,
END OF TY_KONV.

*----------------------------------------------------------------------*
*Internal tables
*----------------------------------------------------------------------*

data : it_data type standard table of ty_data with header line.
data : it_MSEG type standard table of ty_MSEG with header line.
data : it_lfa1 type standard table of ty_lfa1 with header line.
DATA : IT_EKPO TYPE STANDARD TABLE OF TY_EKPO WITH HEADER LINE.
DATA : IT_MAKT TYPE STANDARD TABLE OF TY_MAKT WITH HEADER LINE.
DATA : IT_KONV TYPE STANDARD TABLE OF TY_KONV WITH HEADER LINE.




*---------------------------------------------------------------------*
* WORK AREAS Begin with WA *
*---------------------------------------------------------------------*


*----------------------------------------------------------------------*
*Constants Begin with C_
*----------------------------------------------------------------------*

CONSTANTS: C_DESC(60) TYPE C VALUE 'PROCUREMENT DETAILS AGAINST ADVANCE LICENSES'.
DATA : C_INFO(65) TYPE C.

*---------------------------------------------------------------------*
* Data Variables Begin with w_
*
*---------------------------------------------------------------------*

DATA: W_FIELDCATALOG TYPE SLIS_T_FIELDCAT_ALV WITH HEADER LINE,
W_LAYOUT TYPE SLIS_LAYOUT_ALV,
W_LISTHEADER TYPE SLIS_T_LISTHEADER,
W_EVENTS TYPE SLIS_T_EVENT,
W_TOP_OF_PAGE TYPE SLIS_FORMNAME VALUE 'TOP_OF_PAGE',
W_REPID TYPE SY-REPID.

*---------------------------------------------------------------------*
* parameters *
*---------------------------------------------------------------------*

SELECTION-SCREEN BEGIN OF BLOCK B1 WITH FRAME TITLE TEXT-001.

SELECTION-SCREEN skip 1.

SELECT-OPTIONS : SO_LISNO FOR ZVVF_MT018_ADVLI-LICENSENO obligatory.

SELECTION-SCREEN skip 1.


SELECTION-SCREEN END OF block B1.


*---------------------------------------------------------------------*
* Select-options *
*---------------------------------------------------------------------*



*---------------------------------------------------------------------*
* INITIALIZATION *
*---------------------------------------------------------------------*

INITIALIZATION.

W_REPID = SY-REPID.

REFRESH : IT_DATA,IT_LFA1,IT_EKPO,IT_MAKT.

CLEAR : IT_DATA,IT_LFA1,IT_EKPO,IT_MAKT.

PERFORM F002_eventtab_build_temp USING w_events[].

*---------------------------------------------------------------------*
* AT SELECTION-SCREEN output.
*---------------------------------------------------------------------*

At Selection-screen output .


*---------------------------------------------------------------------*
* At selection screen *
*---------------------------------------------------------------------*

At Selection-screen.

PERFORM F007_LIST_HEADING.

PERFORM F008_VALIDATION.

*---------------------------------------------------------------------*
* START-OF-SELECTION *
*---------------------------------------------------------------------*


START-OF-SELECTION .


PERFORM F003_FIELDCAT_INIT.

PERFORM F001_GET_DATA.

PERFORM F004_DISPLAY_DATA USING W_LISTHEADER[].



*---------------------------------------------------------------------*
* END-OF-SELECTION *
*---------------------------------------------------------------------*

END-OF-SELECTION.

PERFORM F005_DISPLAY_LIST.


*----------------------------------------------------------------------*
* TOP-OF-PAGE *
*----------------------------------------------------------------------*
TOP-OF-PAGE.


*----------------------------------------------------------------------*
* TOP-OF-PAGE *
*----------------------------------------------------------------------*
END-OF-PAGE.

*&---------------------------------------------------------------------*
*& Form F001_GET_DATA
*&---------------------------------------------------------------------*
FORM F001_GET_DATA .



SELECT EBELN EBELP MENGE INTO CORRESPONDING FIELDS OF TABLE IT_MSEG
FROM MSEG FOR ALL ENTRIES IN IT_DATA
WHERE EBELN = IT_DATA-EBELN AND
EBELP = IT_DATA-EBELP AND
BWART IN ('101','102','105','106').

SORT IT_MSEG BY EBELN EBELP.
LOOP AT IT_MSEG.
AT END OF EBELP.
SUM.
READ TABLE IT_DATA WITH KEY EBELN = IT_MSEG-EBELN
EBELP = IT_MSEG-EBELP.
IF SY-SUBRC = 0.
IT_DATA-MENGE = IT_MSEG-MENGE.
MODIFY IT_DATA TRANSPORTING MENGE WHERE EBELN = IT_MSEG-EBELN AND
EBELP = IT_MSEG-EBELP.
ENDIF.
ENDAT.
ENDLOOP.
*HERE AS COMPLETE DATA IS NOT FETCHED IF WE DONT TAKE '*'
*SO '*' IS TAKEN HERE.

SELECT * INTO CORRESPONDING FIELDS OF TABLE IT_KONV
FROM KONV
FOR ALL ENTRIES IN IT_DATA
WHERE KNUMV = IT_DATA-KNUMV
AND KSCHL IN ('ZP00','ZINS','ZFB1','ZFA1','ZFC1','ZP01').

IF SY-SUBRC = 0.
SORT IT_DATA.
SORT IT_KONV BY KNUMV KPOSN.
LOOP AT IT_KONV.

AT END OF KPOSN.
SUM.
READ TABLE IT_DATA WITH KEY KNUMV = IT_KONV-KNUMV EBELP = IT_KONV-KPOSN BINARY SEARCH.
IF SY-SUBRC = 0.
IT_DATA-GRVALUE = IT_KONV-KBETR * IT_DATA-MENGE.
IT_DATA-RATE = IT_KONV-KBETR.
MODIFY IT_DATA TRANSPORTING GRVALUE RATE WHERE KNUMV = IT_KONV-KNUMV AND
EBELP = IT_KONV-KPOSN.
ENDIF.
ENDAT.
ENDLOOP.
ENDIF.

SELECT EBELN EBELP MATNR MENGE
INTO CORRESPONDING FIELDS OF TABLE IT_EKPO
FROM EKPO
FOR ALL ENTRIES IN IT_DATA
WHERE EBELN = IT_DATA-EBELN AND
EBELP = IT_DATA-EBELP.
IF SY-SUBRC = 0.
LOOP AT IT_DATA.
READ TABLE IT_EKPO WITH KEY EBELN = IT_DATA-EBELN EBELP = IT_DATA-EBELP.
IF SY-SUBRC = 0.
IT_DATA-MATNR1 = IT_EKPO-MATNR.
IT_DATA-MENGE1 = IT_EKPO-MENGE.
MODIFY IT_DATA TRANSPORTING MATNR MATNR1 MENGE1
WHERE EBELN = IT_EKPO-EBELN AND
EBELP = IT_EKPO-EBELP.
ENDIF.
ENDLOOP.
ENDIF.


select lifnr name1 into corresponding fields of table it_lfa1
from lfa1
for all entries in it_data
where lifnr = it_data-lifnr.
IF SY-SUBRC = 0.
ENDIF.

SELECT MATNR MAKTX INTO CORRESPONDING FIELDS OF TABLE IT_MAKT
FROM MAKT
FOR ALL ENTRIES IN IT_DATA
WHERE MATNR = IT_DATA-MATNR1.
IF SY-SUBRC = 0.
ENDIF.
SORT IT_LFA1.
SORT IT_MAKT.
loop at it_data.

read table it_lfa1 with key lifnr = it_data-lifnr BINARY SEARCH.
read table it_MAKT with key MATNR = it_data-MATNR1 BINARY SEARCH.
if sy-subrc = 0.
it_data-name1 = it_lfa1-name1.
it_data-MAKTX = it_MAKT-MAKTX.
modify it_data transporting MAKTX NAME1.
endif.

PERFORM F006_DELETING_LEADING_ZEROS.

endloop.


ENDFORM. " F001_GET_DATA

*&---------------------------------------------------------------------*
*& Form F002_eventtab_build_temp
*&---------------------------------------------------------------------*
* text
*----------------------------------------------------------------------*
* -->P_W_EVENTS[] text
*----------------------------------------------------------------------*

FORM F002_eventtab_build_temp USING RT_EVENTS TYPE SLIS_T_EVENT.

DATA : LW_EVENT TYPE SLIS_ALV_EVENT.

CALL FUNCTION 'REUSE_ALV_EVENTS_GET'
EXPORTING
I_LIST_TYPE = 0
IMPORTING
ET_EVENTS = RT_EVENTS
EXCEPTIONS
LIST_TYPE_WRONG = 1
OTHERS = 2.
IF SY-SUBRC <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.

READ TABLE RT_EVENTS WITH KEY NAME = SLIS_EV_TOP_OF_PAGE INTO LW_EVENT.
IF SY-SUBRC = 0.
MOVE W_TOP_OF_PAGE TO LW_EVENT-FORM.
APPEND LW_EVENT TO RT_EVENTS.
ENDIF.

ENDFORM. " F002_eventtab_build_temp

*&---------------------------------------------------------------------*
*& Form F003_FIELDCAT_INIT
*&---------------------------------------------------------------------*

FORM F003_FIELDCAT_INIT .

DATA : LW_FIELDCAT TYPE SLIS_FIELDCAT_ALV.

CLEAR LW_FIELDCAT.
LW_FIELDCAT-FIELDNAME = 'LICENSENO'.
LW_FIELDCAT-SELTEXT_M = 'Advance License No'.
LW_FIELDCAT-OUTPUTLEN = 35.
APPEND LW_FIELDCAT TO W_FIELDCATALOG.

* CLEAR LW_FIELDCAT.
* LW_FIELDCAT-FIELDNAME = 'MATNR'.
* LW_FIELDCAT-SELTEXT_M = 'Material No'.
* LW_FIELDCAT-OUTPUTLEN = 18.
* APPEND LW_FIELDCAT TO W_FIELDCATALOG.

CLEAR LW_FIELDCAT.
LW_FIELDCAT-FIELDNAME = 'VALIDFROM'.
LW_FIELDCAT-SELTEXT_M = 'Valid From'.
LW_FIELDCAT-OUTPUTLEN = 8.
APPEND LW_FIELDCAT TO W_FIELDCATALOG.

CLEAR LW_FIELDCAT.
LW_FIELDCAT-FIELDNAME = 'VALIDTO'.
LW_FIELDCAT-SELTEXT_M = 'Valid To '.
LW_FIELDCAT-OUTPUTLEN = 8.
APPEND LW_FIELDCAT TO W_FIELDCATALOG.

CLEAR LW_FIELDCAT.
LW_FIELDCAT-FIELDNAME = 'QTYALLOWED'.
LW_FIELDCAT-SELTEXT_M = 'Qty Allowed'.
LW_FIELDCAT-OUTPUTLEN = 13.
APPEND LW_FIELDCAT TO W_FIELDCATALOG.

CLEAR LW_FIELDCAT.
LW_FIELDCAT-FIELDNAME = 'QTYRESTRICTED'.
LW_FIELDCAT-SELTEXT_M = 'Qty Restricted'.
LW_FIELDCAT-OUTPUTLEN = 13.
APPEND LW_FIELDCAT TO W_FIELDCATALOG.

CLEAR LW_FIELDCAT.
LW_FIELDCAT-FIELDNAME = 'QTYRESERVED'.
LW_FIELDCAT-SELTEXT_M = 'Qty Reserved'.
LW_FIELDCAT-OUTPUTLEN = 13.
APPEND LW_FIELDCAT TO W_FIELDCATALOG.

CLEAR lw_fieldcat.
lw_fieldcat-fieldname = 'MEINS'.
lw_fieldcat-seltext_m = 'UOM'.
lw_fieldcat-outputlen = 3.
APPEND lw_fieldcat TO w_fieldcatalog.


CLEAR LW_FIELDCAT.
LW_FIELDCAT-FIELDNAME = 'LICENSEVALUE'.
LW_FIELDCAT-SELTEXT_M = 'License Value in ($)'.
LW_FIELDCAT-OUTPUTLEN = 13.
APPEND LW_FIELDCAT TO W_FIELDCATALOG.

CLEAR lw_fieldcat.
lw_fieldcat-fieldname = 'WAERS'.
lw_fieldcat-seltext_m = 'Currency Key'.
lw_fieldcat-outputlen = 5.
APPEND lw_fieldcat TO w_fieldcatalog.

CLEAR lw_fieldcat.
lw_fieldcat-fieldname = 'EXCHANGERATE'.
lw_fieldcat-seltext_m = 'Exchange Rate'.
lw_fieldcat-outputlen = 5.
APPEND lw_fieldcat TO w_fieldcatalog.

CLEAR lw_fieldcat.
lw_fieldcat-fieldname = 'LICENSEVALIN'.
lw_fieldcat-seltext_m = 'License Value in (INR)'.
lw_fieldcat-outputlen = 13.
APPEND lw_fieldcat TO w_fieldcatalog.


CLEAR LW_FIELDCAT.
LW_FIELDCAT-FIELDNAME = 'EBELN'.
LW_FIELDCAT-SELTEXT_M = 'PO Number'.
LW_FIELDCAT-OUTPUTLEN = 10.
APPEND LW_FIELDCAT TO W_FIELDCATALOG.

CLEAR LW_FIELDCAT.
LW_FIELDCAT-FIELDNAME = 'AEDAT'.
LW_FIELDCAT-SELTEXT_M = 'PO Date'.
LW_FIELDCAT-OUTPUTLEN = 8.
APPEND LW_FIELDCAT TO W_FIELDCATALOG.

CLEAR LW_FIELDCAT.
LW_FIELDCAT-FIELDNAME = 'LIFNR'.
LW_FIELDCAT-SELTEXT_M = 'Vendor No'.
LW_FIELDCAT-OUTPUTLEN = 10.
APPEND LW_FIELDCAT TO W_FIELDCATALOG.

CLEAR LW_FIELDCAT.
LW_FIELDCAT-FIELDNAME = 'NAME1'.
LW_FIELDCAT-SELTEXT_M = 'Vendor Name'.
LW_FIELDCAT-OUTPUTLEN = 35.
APPEND LW_FIELDCAT TO W_FIELDCATALOG.

CLEAR LW_FIELDCAT.
LW_FIELDCAT-FIELDNAME = 'EBELP'.
LW_FIELDCAT-SELTEXT_M = 'PO Item'.
LW_FIELDCAT-OUTPUTLEN = 5.
APPEND LW_FIELDCAT TO W_FIELDCATALOG.

CLEAR LW_FIELDCAT.
LW_FIELDCAT-FIELDNAME = 'MATNR1'.
LW_FIELDCAT-SELTEXT_M = 'Material No'.
LW_FIELDCAT-OUTPUTLEN = 18.
APPEND LW_FIELDCAT TO W_FIELDCATALOG.

CLEAR LW_FIELDCAT.
LW_FIELDCAT-FIELDNAME = 'MAKTX'.
LW_FIELDCAT-SELTEXT_M = 'Material Description'.
LW_FIELDCAT-OUTPUTLEN = 40.
APPEND LW_FIELDCAT TO W_FIELDCATALOG.

CLEAR LW_FIELDCAT.
LW_FIELDCAT-FIELDNAME = 'MENGE1'.
LW_FIELDCAT-SELTEXT_M = 'PO Quantity'.
LW_FIELDCAT-OUTPUTLEN = 13.
APPEND LW_FIELDCAT TO W_FIELDCATALOG.

CLEAR LW_FIELDCAT.
LW_FIELDCAT-FIELDNAME = 'RATE'.
LW_FIELDCAT-SELTEXT_M = 'Rate Per MT(IN US $)'.
LW_FIELDCAT-OUTPUTLEN = 11.
APPEND LW_FIELDCAT TO W_FIELDCATALOG.


CLEAR LW_FIELDCAT.
LW_FIELDCAT-FIELDNAME = 'MENGE'.
LW_FIELDCAT-SELTEXT_M = 'Goods Receipt Qty'.
LW_FIELDCAT-OUTPUTLEN = 13.
APPEND LW_FIELDCAT TO W_FIELDCATALOG.

CLEAR LW_FIELDCAT.
LW_FIELDCAT-FIELDNAME = 'GRVALUE'.
LW_FIELDCAT-SELTEXT_M = 'GR Value'.
LW_FIELDCAT-OUTPUTLEN = 11.
APPEND LW_FIELDCAT TO W_FIELDCATALOG.


ENDFORM. " F003_FIELDCAT_INIT

*&---------------------------------------------------------------------*
*& Form F004_DISPLAY_DATA
*&---------------------------------------------------------------------*
* text
*----------------------------------------------------------------------*
* -->P_W_LIST_HEADER[] text
*----------------------------------------------------------------------*
FORM F004_DISPLAY_DATA USING lt_top_of_page TYPE slis_t_listheader .

DATA: LW_LINE TYPE SLIS_LISTHEADER.

CLEAR LW_LINE.
LW_LINE-TYP = 'H'.
LW_LINE-INFO = C_DESC.
*W_LAYOUT-TITLE = 'ADVANCE LICENSES'.
APPEND LW_LINE TO LT_TOP_OF_PAGE.
CLEAR LW_LINE.

CLEAR LW_LINE.
LW_LINE-TYP = 'S'.
LW_LINE-INFO = C_INFO.
*W_LAYOUT-TITLE = 'ADVANCE LICENSES'.
APPEND LW_LINE TO LT_TOP_OF_PAGE.
CLEAR LW_LINE.


ENDFORM. " F004_DISPLAY_DATA

*&---------------------------------------------------------------------*
*& Form F005_DISPLAY_LIST
*&---------------------------------------------------------------------*

FORM F005_DISPLAY_LIST .

CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
EXPORTING
* I_INTERFACE_CHECK = ' '
* I_BYPASSING_BUFFER = ' '
* I_BUFFER_ACTIVE = ' '
I_CALLBACK_PROGRAM = W_REPID
* I_CALLBACK_PF_STATUS_SET = ' '
* I_CALLBACK_USER_COMMAND = ' '
I_CALLBACK_TOP_OF_PAGE = 'TOP_OF_PAGE'
* I_CALLBACK_HTML_TOP_OF_PAGE = ' '
* I_CALLBACK_HTML_END_OF_LIST = ' '
* I_STRUCTURE_NAME =
I_BACKGROUND_ID = 'ALV_BACKGROUND'
* I_GRID_TITLE =
* I_GRID_SETTINGS =
IS_LAYOUT = W_LAYOUT
IT_FIELDCAT = W_FIELDCATALOG[]
* IT_EXCLUDING =
* IT_SPECIAL_GROUPS =
* IT_SORT =
* IT_FILTER =
* IS_SEL_HIDE =
* I_DEFAULT = 'X'
* I_SAVE = ' '
* IS_VARIANT =
IT_EVENTS = W_EVENTS
* IT_EVENT_EXIT =
* IS_PRINT =
* IS_REPREP_ID =
* I_SCREEN_START_COLUMN = 0
* I_SCREEN_START_LINE = 0
* I_SCREEN_END_COLUMN = 0
* I_SCREEN_END_LINE = 0
* IT_ALV_GRAPHICS =
* IT_HYPERLINK =
* IT_ADD_FIELDCAT =
* IT_EXCEPT_QINFO =
* I_HTML_HEIGHT_TOP =
* I_HTML_HEIGHT_END =
* IMPORTING
* E_EXIT_CAUSED_BY_CALLER =
* ES_EXIT_CAUSED_BY_USER =
TABLES
T_OUTTAB = IT_DATA
EXCEPTIONS
PROGRAM_ERROR = 1
OTHERS = 2
.
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. " F005_DISPLAY_LIST

*&---------------------------------------------------------------------*
*& Form F006_DELETING_LEADING_ZEROS
*&---------------------------------------------------------------------*

FORM F006_DELETING_LEADING_ZEROS .

SHIFT IT_DATA-MATNR1 LEFT DELETING LEADING '0'.
SHIFT IT_DATA-MATNR LEFT DELETING LEADING '0'.
SHIFT IT_DATA-LIFNR LEFT DELETING LEADING '0'.
MODIFY IT_DATA TRANSPORTING MATNR MATNR1 LIFNR.

ENDFORM. " F006_DELETING_LEADING_ZEROS

*&---------------------------------------------------------------------*
*& Form F007_LIST_HEADING
*&---------------------------------------------------------------------*

FORM F007_LIST_HEADING .

IF SO_LISNO-HIGH NE SPACE.

CONCATENATE 'Advance Licenses for :' SO_LISNO-LOW 'TO' SO_LISNO-HIGH INTO C_INFO SEPARATED BY SPACE.

ELSE.

CONCATENATE 'Advance Licenses for :' SO_LISNO-LOW INTO C_INFO .

ENDIF.


ENDFORM. " F007_LIST_HEADING

*&--------------------------------------------------------------------*
*& Form TOP_OF_PAGE
*&--------------------------------------------------------------------*

FORM TOP_OF_PAGE.
CALL FUNCTION 'REUSE_ALV_COMMENTARY_WRITE'
EXPORTING
it_list_commentary = W_LISTHEADER
i_logo = ' '.
ENDFORM. "top_of_page_db

*&---------------------------------------------------------------------*
*& Form F008_VALIDATION
*&---------------------------------------------------------------------*

FORM F008_VALIDATION .

SELECT P~LICENSENO P~MATNR P~VALIDFROM P~VALIDTO P~QTYALLOWED
P~QTYRESTRICTED P~MEINS P~QTYRESERVED P~LICENSEVALUE
P~WAERS P~EXCHANGERATE
P~LICENSEVALIN
Q~EBELP
R~EBELN R~AEDAT R~LIFNR R~KNUMV
* S~MENGE
INTO CORRESPONDING FIELDS OF TABLE IT_DATA
FROM ZVVF_MT018_ADVLI as p
inner join ekpo as q
on Q~idnlf = P~licenseno and
q~matnr = p~matnr
inner join ekko as r
on R~ebeln = Q~ebeln
* inner join mseg as s
* on S~ebeln = Q~ebeln
* S~EBELP = Q~EBELP
where p~licenseno IN SO_LISNO.

IF SY-SUBRC NE 0.

MESSAGE E000(ZVVF_MS018_MSGCLA).

ENDIF.


ENDFORM. " F008_VALIDATION

No comments:

link us...

For Visitors

if you want to publish or Add something on ERP, SAP , SAP FUNCTIONAL, SAP ABAP then mail us along with your email-id. contain must be yours

email-id :- avinashkr_raj@yahoo.com(any email)

email-id :- avinaskr_raj.abap@blogger.com ( use only gmail)