List of materials inventory - using ALV
REPORT Z_LIST_MATERIALS.
TYPE-POOLS: SLIS.
TABLES:MARC, MARD, VBAP, LIPS, EKPO, VBFA, EKBE, MARM, VBBE, MARA, MBEW.
SELECTION-SCREEN BEGIN OF BLOCK SEL WITH FRAME TITLE TEXT-001.
SELECT-OPTIONS: S_WERKS FOR MARC-WERKS, " Plant
S_MATNR FOR MARC-MATNR, " Material
S_MTART FOR MARA-MTART. " Material Type
SELECTION-SCREEN END OF BLOCK SEL.
PARAMETERS: P_VARI LIKE DISVARIANT-VARIANT. " ALV Variant
CONSTANTS: FORMNAME_TOP_OF_PAGE TYPE SLIS_FORMNAME VALUE 'TOP_OF_PAGE'.
DATA: BEGIN OF INV OCCURS 100,
WERKS LIKE MARD-WERKS, " Plant
MATNR LIKE MARD-MATNR, " Material
MTART LIKE MARA-MTART, " Material Type
STPRS LIKE MBEW-STPRS, " Standard Price
AVAIL LIKE MARD-LABST, " Available
LABST LIKE MARD-LABST, " Unrestricted use
INSME LIKE MARD-INSME, " Quality Inspection
RETME LIKE MARD-RETME, " Returns
TRANS LIKE MARC-UMLMC, " Stock in transit (calculated)
UMLMC LIKE MARC-UMLMC, " Stock Transfer (plant)
UMLME LIKE MARD-UMLME, " Transfer (SLoc)
WESBS LIKE EKBE-WESBS, " GR Blocked Stock
TRAME LIKE MARC-TRAME, " Stock in transit
SPEME LIKE MARD-SPEME, " Blocked
KWMENG LIKE VBAP-KWMENG, " Sales orders
LFIMG LIKE LIPS-LFIMG, " Scheduled for Delivery
MENGE LIKE EKPO-MENGE, " Open Purch. Orders
VALUE LIKE MBEW-SALK3, " Stock Value (Calculated)
MEINS LIKE MARA-MEINS, " Unit of measure
END OF INV.
DATA: FIELDTAB TYPE SLIS_T_FIELDCAT_ALV,
HEADING TYPE SLIS_T_LISTHEADER,
LAYOUT TYPE SLIS_LAYOUT_ALV,
EVENTS TYPE SLIS_T_EVENT,
REPNAME LIKE SY-REPID,
F2CODE LIKE SY-UCOMM VALUE '&ETA',
G_SAVE(1) TYPE C,
G_EXIT(1) TYPE C,
G_VARIANT LIKE DISVARIANT,
GX_VARIANT LIKE DISVARIANT.
INITIALIZATION.
REPNAME = SY-REPID.
PERFORM INITIALIZE_FIELDCAT USING FIELDTAB[].
PERFORM BUILD_EVENTTAB USING EVENTS[].
PERFORM BUILD_COMMENT USING HEADING[].
PERFORM INITIALIZE_VARIANT.
AT SELECTION-SCREEN ON VALUE-REQUEST FOR P_VARI.
PERFORM F4_FOR_VARIANT.
AT SELECTION-SCREEN.
PERFORM PAI_OF_SELECTION_SCREEN.
START-OF-SELECTION.
PERFORM GET_MARD.
PERFORM GET_UNIT_OF_MEASURE.
PERFORM GET_MARC.
PERFORM GET_EKPO.
PERFORM GET_LIPS.
PERFORM GET_VBAP.
PERFORM GET_OPEN.
PERFORM GET_PRICE.
END-OF-SELECTION.
PERFORM BUILD_LAYOUT USING LAYOUT.
PERFORM WRITE_OUTPUT.
*& Form INITIALIZE_FIELDCAT
text
-->P_FIELDTAB[] text *
FORM INITIALIZE_FIELDCAT USING P_FIELDTAB TYPE SLIS_T_FIELDCAT_ALV.
DATA: L_FIELDCAT TYPE SLIS_FIELDCAT_ALV.
fixed columns (obligatory)
CLEAR L_FIELDCAT.
L_FIELDCAT-TABNAME = 'INV'.
L_FIELDCAT-FIX_COLUMN = 'X'.
L_FIELDCAT-NO_OUT = 'O'.
L_FIELDCAT-FIELDNAME = 'WERKS'.
APPEND L_FIELDCAT TO P_FIELDTAB.
L_FIELDCAT-FIELDNAME = 'MATNR'.
APPEND L_FIELDCAT TO P_FIELDTAB.
totalized columns
CLEAR L_FIELDCAT.
L_FIELDCAT-TABNAME = 'INV'.
L_FIELDCAT-SP_GROUP = 'A'.
L_FIELDCAT-DO_SUM = 'X'.
L_FIELDCAT-FIELDNAME = 'LABST'.
APPEND L_FIELDCAT TO P_FIELDTAB.
L_FIELDCAT-FIELDNAME = 'INSME'.
APPEND L_FIELDCAT TO P_FIELDTAB.
L_FIELDCAT-FIELDNAME = 'RETME'.
APPEND L_FIELDCAT TO P_FIELDTAB.
L_FIELDCAT-FIELDNAME = 'UMLME'.
APPEND L_FIELDCAT TO P_FIELDTAB.
L_FIELDCAT-FIELDNAME = 'WESBS'.
APPEND L_FIELDCAT TO P_FIELDTAB.
L_FIELDCAT-FIELDNAME = 'SPEME'.
APPEND L_FIELDCAT TO P_FIELDTAB.
columns with different description
L_FIELDCAT-FIELDNAME = 'KWMENG'.
L_FIELDCAT-SELTEXT_M = 'Sales Orders'.
L_FIELDCAT-SELTEXT_S = 'Sales Or'.
L_FIELDCAT-SELTEXT_L = 'Sales Orders Qty'.
APPEND L_FIELDCAT TO P_FIELDTAB.
L_FIELDCAT-FIELDNAME = 'LFIMG'.
L_FIELDCAT-SELTEXT_M = 'Sched. Delivery'.
L_FIELDCAT-SELTEXT_S = 'Schd. Del'.
L_FIELDCAT-SELTEXT_L = 'Scheduled for Delivery'.
APPEND L_FIELDCAT TO P_FIELDTAB.
L_FIELDCAT-FIELDNAME = 'TRANS'.
L_FIELDCAT-SELTEXT_M = 'Stk. in transit'.
L_FIELDCAT-SELTEXT_S = 'Stk. trns'.
L_FIELDCAT-SELTEXT_L = 'Stock in transit (sum)'.
APPEND L_FIELDCAT TO P_FIELDTAB.
L_FIELDCAT-FIELDNAME = 'AVAIL'.
L_FIELDCAT-SELTEXT_M = 'Available'.
L_FIELDCAT-SELTEXT_S = 'Avail.'.
L_FIELDCAT-SELTEXT_L = 'Stock Available'.
APPEND L_FIELDCAT TO P_FIELDTAB.
L_FIELDCAT-FIELDNAME = 'MENGE'.
L_FIELDCAT-SELTEXT_M = 'Open Orders'.
L_FIELDCAT-SELTEXT_S = 'Open Ord'.
L_FIELDCAT-SELTEXT_L = 'Open Purchase Orders'.
APPEND L_FIELDCAT TO P_FIELDTAB.
columns not displayed
CLEAR L_FIELDCAT.
L_FIELDCAT-TABNAME = 'INV'.
L_FIELDCAT-SP_GROUP = 'A'.
L_FIELDCAT-NO_OUT = 'X'.
L_FIELDCAT-FIELDNAME = 'MEINS'.
APPEND L_FIELDCAT TO P_FIELDTAB.
L_FIELDCAT-FIELDNAME = 'UMLMC'.
APPEND L_FIELDCAT TO P_FIELDTAB.
L_FIELDCAT-FIELDNAME = 'TRAME'.
APPEND L_FIELDCAT TO P_FIELDTAB.
L_FIELDCAT-FIELDNAME = 'STPRS'.
APPEND L_FIELDCAT TO P_FIELDTAB.
L_FIELDCAT-FIELDNAME = 'VALUE'.
APPEND L_FIELDCAT TO P_FIELDTAB.
ENDFORM. " INITIALIZE_FIELDCAT
*& Form BUILD_EVENTTAB
text
-->P_EVENTS[] text *
FORM BUILD_EVENTTAB USING P_EVENTS TYPE SLIS_T_EVENT.
DATA: LS_EVENT TYPE SLIS_ALV_EVENT.
CALL FUNCTION 'REUSE_ALV_EVENTS_GET'
EXPORTING
I_LIST_TYPE = 0
IMPORTING
ET_EVENTS = P_EVENTS.
READ TABLE P_EVENTS WITH KEY NAME = SLIS_EV_TOP_OF_PAGE
INTO LS_EVENT.
IF SY-SUBRC = 0.
MOVE FORMNAME_TOP_OF_PAGE TO LS_EVENT-FORM.
APPEND LS_EVENT TO P_EVENTS.
ENDIF.
ENDFORM. " BUILD_EVENTTAB
*& Form BUILD_COMMENT
text
-->P_HEADING[] text *
FORM BUILD_COMMENT USING P_HEADING TYPE SLIS_T_LISTHEADER.
DATA: HLINE TYPE SLIS_LISTHEADER,
TEXT(60) TYPE C,
SEP(20) TYPE C.
CLEAR: HLINE, TEXT.
HLINE-TYP = 'H'.
WRITE: TEXT-101 TO TEXT+23.
HLINE-INFO = TEXT.
APPEND HLINE TO P_HEADING.
CLEAR TEXT.
WRITE: 'User: ' TO TEXT,
SY-UNAME TO TEXT+6,
'Date: ' TO TEXT+25,
SY-DATUM TO TEXT+31,
'Page: ' TO TEXT+50,
SY-PAGNO TO TEXT+56.
HLINE-INFO = TEXT.
APPEND HLINE TO P_HEADING.
ENDFORM. " BUILD_COMMENT
FORM TOP_OF_PAGE *
FORM TOP_OF_PAGE.
CALL FUNCTION 'REUSE_ALV_COMMENTARY_WRITE'
EXPORTING
IT_LIST_COMMENTARY = HEADING.
ENDFORM.
*& Form INITIALIZE_VARIANT
text
FORM INITIALIZE_VARIANT.
G_SAVE = 'A'.
CLEAR G_VARIANT.
G_VARIANT-REPORT = REPNAME.
GX_VARIANT = G_VARIANT.
CALL FUNCTION 'REUSE_ALV_VARIANT_DEFAULT_GET'
EXPORTING
I_SAVE = G_SAVE
CHANGING
CS_VARIANT = GX_VARIANT
EXCEPTIONS
NOT_FOUND = 2.
IF SY-SUBRC = 0.
P_VARI = GX_VARIANT-VARIANT.
ENDIF.
ENDFORM. " INITIALIZE_VARIANT
*& Form F4_FOR_VARIANT
text
FORM F4_FOR_VARIANT.
CALL FUNCTION 'REUSE_ALV_VARIANT_F4'
EXPORTING
IS_VARIANT = G_VARIANT
I_SAVE = G_SAVE
IMPORTING
E_EXIT = G_EXIT
ES_VARIANT = GX_VARIANT
EXCEPTIONS
NOT_FOUND = 2.
IF SY-SUBRC = 2.
MESSAGE ID SY-MSGID TYPE 'S' NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ELSE.
IF G_EXIT = SPACE.
P_VARI = GX_VARIANT-VARIANT.
ENDIF.
ENDIF.
ENDFORM. " F4_FOR_VARIANT
*& Form PAI_OF_SELECTION_SCREEN
text
FORM PAI_OF_SELECTION_SCREEN.
IF NOT P_VARI IS INITIAL.
MOVE G_VARIANT TO GX_VARIANT.
MOVE P_VARI TO GX_VARIANT-VARIANT.
CALL FUNCTION 'REUSE_ALV_VARIANT_EXISTENCE'
EXPORTING
I_SAVE = G_SAVE
CHANGING
CS_VARIANT = GX_VARIANT.
G_VARIANT = GX_VARIANT.
ELSE.
PERFORM INITIALIZE_VARIANT.
ENDIF.
ENDFORM. " PAI_OF_SELECTION_SCREEN
*& Form GET_MARD
text
FORM GET_MARD.
SELECT MATNR WERKS LABST INSME RETME UMLME SPEME
FROM MARD
INTO CORRESPONDING FIELDS OF INV
WHERE MATNR IN S_MATNR
AND WERKS IN S_WERKS.
COLLECT INV.
ENDSELECT.
PERFORM FILTER_BY_MATERIAL_TYPE.
ENDFORM. " GET_MARD
*& Form FILTER_BY_MATERIAL_TYPE
text
FORM FILTER_BY_MATERIAL_TYPE.
LOOP AT INV.
CLEAR INV-MTART.
SELECT SINGLE MTART
INTO INV-MTART
FROM MARA
WHERE MATNR EQ INV-MATNR
AND MTART IN S_MTART.
IF SY-SUBRC EQ 0.
MODIFY INV.
ELSE.
DELETE INV.
ENDIF.
ENDLOOP.
ENDFORM. " FILTER_BY_MATERIAL_TYPE
*& Form GET_MARC
text
FORM GET_MARC.
LOOP AT INV.
SELECT SINGLE UMLMC TRAME
FROM MARC
INTO CORRESPONDING FIELDS OF INV
WHERE MATNR EQ INV-MATNR
AND WERKS EQ INV-WERKS.
IF SY-SUBRC EQ 0.
INV-TRANS = INV-UMLMC + INV-TRAME.
MODIFY INV.
ENDIF.
ENDLOOP.
ENDFORM. " GET_MARC
*& Form GET_EKPO
text
FORM GET_EKPO.
DATA: WESBS LIKE INV-WESBS,
SHKZG LIKE EKBE-SHKZG,
MEINS LIKE EKPO-MEINS,
LMEIN LIKE EKPO-LMEIN.
LOOP AT INV.
CLEAR: WESBS, SHKZG, MEINS, LMEIN.
SELECT YWESBS YSHKZG XMEINS XLMEIN
INTO (WESBS, SHKZG, MEINS, LMEIN)
FROM EKPO AS X JOIN EKBE AS Y
ON XEBELN = YEBELN
AND XEBELP = YEBELP
WHERE X~MATNR EQ INV-MATNR
AND X~WERKS EQ INV-WERKS
AND X~LOEKZ NE 'L'.
IF SHKZG EQ 'H'.
MULTIPLY WESBS BY -1.
ENDIF.
IF MEINS NE LMEIN.
PERFORM CONVERT_UNIT_OF_MEASURE CHANGING INV-MATNR MEINS WESBS.
ENDIF.
ADD WESBS TO INV-WESBS.
ENDSELECT.
MODIFY INV.
ENDLOOP.
ENDFORM. " GET_EKPO
*& Form GET_LIPS
text
FORM GET_LIPS.
DATA: LFIMG LIKE INV-LFIMG.
LOOP AT INV.
CLEAR: LFIMG, INV-LFIMG.
SELECT OMENG
INTO LFIMG
FROM VBBE
WHERE MATNR EQ INV-MATNR
AND WERKS EQ INV-WERKS
AND VBTYP EQ 'J'.
ADD LFIMG TO INV-LFIMG.
ENDSELECT.
MODIFY INV.
ENDLOOP.
ENDFORM. " GET_LIPS
*& Form GET_VBAP
text
FORM GET_VBAP.
DATA: KWMENG LIKE INV-KWMENG.
LOOP AT INV.
CLEAR: KWMENG, INV-KWMENG.
SELECT OMENG
INTO KWMENG
FROM VBBE
WHERE MATNR EQ INV-MATNR
AND WERKS EQ INV-WERKS
AND VBTYP EQ 'C'.
ADD KWMENG TO INV-KWMENG.
ENDSELECT.
INV-AVAIL = INV-LABST - INV-INSME - INV-KWMENG - INV-LFIMG.
MODIFY INV.
ENDLOOP.
ENDFORM. " GET_VBAP
*& Form GET_UNIT_OF_MEASURE
text
--> p1 text
<-- p2 text
FORM GET_UNIT_OF_MEASURE.
LOOP AT INV.
SELECT SINGLE MEINS
FROM MARA
INTO INV-MEINS
WHERE MATNR EQ INV-MATNR.
MODIFY INV.
ENDLOOP.
ENDFORM. " GET_UNIT_OF_MEASURE
*& Form GET_OPEN
text
FORM GET_OPEN.
DATA: BEGIN OF XTAB OCCURS 10, " Open orders table
WERKS LIKE EKPO-WERKS,
LGORT LIKE EKPO-LGORT,
MATNR LIKE EKPO-MATNR,
MENGE LIKE EKPO-MENGE,
MENGK LIKE EKPO-MENGE,
END OF XTAB.
RANGES: L_WERKS FOR MARD-WERKS.
LOOP AT INV.
REFRESH XTAB.
CLEAR: XTAB, L_WERKS.
MOVE INV-WERKS TO L_WERKS-LOW.
CALL FUNCTION 'MB_ADD_PURCHASE_ORDER_QUANTITY'
EXPORTING
X_MATNR = INV-MATNR
X_MEINS = INV-MEINS
X_ELIKZ = SPACE
X_LOEKZ = SPACE
TABLES
XTAB = XTAB
XWERKS = L_WERKS.
MOVE XTAB-MENGE TO INV-MENGE.
MODIFY INV.
ENDLOOP.
ENDFORM. " GET_OPEN
*& Form GET_PRICE
text
FORM GET_PRICE.
LOOP AT INV.
SELECT SINGLE STPRS
FROM MBEW
INTO INV-STPRS
WHERE MATNR EQ INV-MATNR
AND BWKEY EQ INV-WERKS
AND BWTAR EQ SPACE.
IF SY-SUBRC EQ 0.
INV-VALUE = INV-STPRS *
( INV-LABST + INV-INSME + INV-TRANS + INV-SPEME ).
MODIFY INV.
ENDIF.
ENDLOOP.
ENDFORM. " GET_PRICE
FORM CONVERT_UNIT_OF_MEASURE *
text *
--> P_MATNR *
--> P_VRKME *
--> P_QUANT *
FORM CONVERT_UNIT_OF_MEASURE USING P_MATNR P_VRKME P_QUANT.
DATA: UMREZ LIKE MARM-UMREZ,
UMREN LIKE MARM-UMREN.
SELECT SINGLE UMREZ UMREN
INTO (UMREZ, UMREN)
FROM MARM
WHERE MATNR EQ P_MATNR
AND MEINH EQ P_VRKME.
IF SY-SUBRC EQ 0.
COMPUTE P_QUANT = ( P_QUANT * UMREZ ) / UMREN.
ENDIF.
ENDFORM.
*& Form BUILD_LAYOUT
text
-->P_LAYOUT text *
FORM BUILD_LAYOUT USING P_LAYOUT TYPE SLIS_LAYOUT_ALV.
P_LAYOUT-F2CODE = F2CODE.
P_LAYOUT-ZEBRA = 'X'.
P_LAYOUT-DETAIL_POPUP = 'X'.
ENDFORM. " BUILD_LAYOUT
*& Form WRITE_OUTPUT
text
FORM WRITE_OUTPUT.
SORT INV BY WERKS MATNR.
CALL FUNCTION 'REUSE_ALV_FIELDCATALOG_MERGE'
EXPORTING
I_PROGRAM_NAME = REPNAME
I_INTERNAL_TABNAME = 'INV'
I_INCLNAME = REPNAME
CHANGING
CT_FIELDCAT = FIELDTAB.
IF SY-SUBRC <> 0.
WRITE: 'SY-SUBRC: ', SY-SUBRC, 'REUSE_ALV_FIELDCATALOG_MERGE'.
ENDIF.
CALL FUNCTION 'REUSE_ALV_LIST_DISPLAY'
EXPORTING
I_CALLBACK_PROGRAM = REPNAME
I_STRUCTURE_NAME = 'INV'
IS_LAYOUT = LAYOUT
IT_FIELDCAT = FIELDTAB
I_DEFAULT = 'A'
I_SAVE = G_SAVE
IS_VARIANT = G_VARIANT
IT_EVENTS = EVENTS[]
TABLES
T_OUTTAB = INV.
IF SY-SUBRC <> 0.
WRITE: 'SY-SUBRC: ', SY-SUBRC, 'REUSE_ALV_LIST_DISPLAY'.
ENDIF.
ENDFORM. " WRITE_OUTPUT
by: akshat
Hi ,
User transaction MC.9 it will show inventory , value etc as per yor requirement.
Regards
Hari
Similar Messages
-
How to download subtotals into xl sheet while using alv list display
hi all,
i have a reqiurement i.e.
iam displaying the data by using alv list display. i have one option called Download in my PF-STATUS.when i click this button it downloads the data .now my requirement is when i cllick on subtotals list displays asubtotals according to the sales order no.now i click doenload button then it has download the data into xlsheet with subtotals and grandtotals.
anybody can send me the sample code plz.
thanks,
maheedhar.tHello Maheedhar
Using ALV lists you do not need a special function for downloading. Simply calculate the totals and subtotals on your ALV list and then press the (toolbar or menu bar) button <b>"Print Preview...".</b>
The print preview display a "flat" list including the subtotals that can be downloaded to Excel.
Regards
Uwe -
Table Maintenance Generator via program using ALV OO concept
Hi All,
I have a requriement to update the table using OO ALV i.e table maintenance generator program.
My Z table have three fields say.. NEW status, old status and flag.
I have to dispaly the records of the Z table in Matrix format.
for example the records of the Z table is
New status
Old status
Flag
N1
O11
F11
N1
O12
F12
N1
O13
F13
N2
O21
F21
N2
O22
F22
N2
O23
F23
N3
O31
F31
N3
O32
F32
N3
O33
F33
My program have to display the records of the table in matrix format i.e
| ..... | O11 | O12 | O13 | O21 | O22 | O23 | O31 | O32 | O33 | ..
| N1 | F11 | F12 | F13 | ..... | ..... | .... | ..... | ....... | .... | .. ____________________________________________________________________________________
| N2 | ..... | ...... | ....... | F21 | F22 | F23 | ... | ..... | ...... | .
| N3 | ...... | ..... | ....... . | ....... | ....... | .... | F31 | F32 | F33 |
The ALV display is dynamic i.e it depends upon the no. of records in the table...
My headings( Row heading and Column heading ) will be the value from table... and the user should be able to change the Flag ... For example when the user change the Flag 'F21' to say 'X',
| ..... | O11 | O12 | O13 | O21 | O22 | O23 | O31 | O32 | O33 | ..
| N1 | F11 | F12 | F13 | ..... | ..... | .... | ..... | ....... | .... | .. ____________________________________________________________________________________
| N2 | ..... | ...... | ....... | X | F22 | F23 | ... | ..... | ...... | .
| N3 | ...... | ..... | ....... . | ....... | ....... | .... | F31 | F32 | F33 | .
In the Z table the record is
N2 O21 F21
should be changed to
N2 O21 X
I tried using ALV oo concept....but I can able to display the output as like it is in table ....Not like the one above format....
Can you please help me to resolve it?
Thanx in advance
Sangeetha
Edited by: sangeetha s k on Dec 16, 2008 7:42 AM
Edited by: sangeetha s k on Dec 16, 2008 7:50 AM
Edited by: sangeetha s k on Dec 16, 2008 8:04 AMHi,
Go through Following Menu Path
Tcode SE11-> Table Name-> Change.
Utilities-> Table Maintance Generator->Create Maintance.
On Same Screen go to Menu Environment->Modification->Events
Create New Event e.g. 05 , Enter Form Routine Name.
Go to Editor.
and Put Your Logic
e.g.
FORM FILL_DEFAULT.
* Actual Logic for how to get materials list.
ENDFORM. -
Cannot get the details in ME2N when using ALV but can when using BEST
Hi experts,
Could you let me know why I am not able to get the results when using ALV as Scope of List in ME2N Transaction, but can get data when using BEST?
Regards,
PriHi Priya,
Check the following :
IMG-> Materials Management-> Purchasing-> Reporting-> Scope of List->Define Scope of List
Here select ALV and click details.
Check the check boxes you need.
Cheers,
Satish -
List of materials from the excel which are not posted
I have written bdc,
that ware house storage locations should not be allowed.
All the storage locations in the table T320 are ware house storage locations.
so i have written
if not it_data1 is initial.
SELECT * into table iT_320 FROM T320
for all entries in it_data1
where WERKS = it_data1-werks and
LGORT = it_data1-lgort.
endif.
LOOP AT IT_DATA1 .
read table iT_320 INTO wa_320 with key werks = it_data1-werks
lgort = it_data1-lgort.
IF sy-subrc = 0 .
delete it_data1 index sy-tabix.
ENDIF.
endloop.
So its working fine till then.
but i wanted a list of materials from the excel wch are not posted,so tht the user is aware tht some items are not consumed.
How to display that list in bdc.
Please give the code for that.MY EXCEL DATA IS IN IT_DATA1.
LOOP AT IT_DATA1 .
read table iT_320 INTO wa_320 with key werks = it_data1-werks
lgort = it_data1-lgort.
IF sy-subrc = 0 .
delete it_data1 index sy-tabix.
ENDIF.
endloop.
LOOP AT IT_DATA1 .
MOVE-CORRESPONDING IT_DATA1 TO IT_DATA_h.
Collect it_data_h.
ENDLOOP.
Clear it_data_h.
clear : it_data1.
THEN MY BDC IS LIKE THIS.
LOOP AT IT_DATA_H .
perform bdc_dynpro using 'SAPMM07M' '0400'.
perform bdc_field using 'BDC_CURSOR'
'RM07M-WERKS'.
perform bdc_field using 'BDC_OKCODE'
'/00'.
perform bdc_field using 'MKPF-BLDAT' LV_DATE .
perform bdc_field using 'MKPF-BUDAT' LV_DATE.
perform bdc_field using 'RM07M-BWARTWA' '261'.
perform bdc_field using 'RM07M-WERKS' IT_DATA_H-WERKS.
perform bdc_dynpro using 'SAPMM07M' '0421'.
perform bdc_field using 'BDC_CURSOR'
'MSEG-WERKS(03)'.
CLEAR : FLAG1, W_FLAG.
LOOP AT IT_DATA1 WHERE aufnr = it_data_H-aufnr.
W_FLAG = 1.
CONCATENATE 'MSEG-MATNR' '(' W_FLAG ')' INTO W_MATNR_C.
perform bdc_field using W_MATNR_C
IT_DATA1-MATNR.
CLEAR : QTY.
QTY = IT_DATA1-ERFMG.
SHIFT QTY LEFT DELETING LEADING SPACE.
END LOOP.
NOW HOW TO COMPARE THE MATERIALS IN EXCEL AND BDC POSTED.
PLEASE PROVIDE THE CODE FOR THAT AND HOW TO DISPLAY. -
How to trigger New page while using ALV with classes/oops?
Hi All
I am trying to print a report which has to show the data in two pages.
I am using ALV with classes/oops.
Though I am able to print the report but a new page is not coming. Whole of the data is coming in one single page.
Please tell me as to how to trigger a NEW PAGE while using ALV with classes/oops.
Please send some code samples also if available.
Thanks in advance.
Jerryusing sort option you can do it. in case of grid/oo alv class ALV you can view that only in print mode/preview mode.
in case of list you can view that directly.
sort-fieldname = 'FIELDNAME'.
sort-group = '*' "triggers new page
sort-up = 'X'.
append sort to it_sort. -
How to get the list of materials from Sap r/3
Hi Experts,
I have one doubt, here iam implementing
HTTP TO RFC scenario.
My doubts are------
1. Should we create DT MT MI and all (OR) not
2.In Request DT how the message structure wil be to get the list of materials from sap r/3 system as Response(Ex: Fields in the source structure).
3.Or the second thing is how to get the list of materials start with some alphabate.
Please reply me for each and every questions mentioned above. Please clarify me.
Helpful answers wil be rewarded.
Reagards
khannaHi Khanna,
<i> 1. Should we create DT MT MI and all (OR) not</i>
Yes U need to create for HTTP site...for RFC U need to import..
<i>2.In Request DT how the message structure wil be to get the list of materials from sap r/3 system as Response(Ex: Fields in the source structure).</i>
You create your own structres for Request and respoce.. and Map it with RFC..
<i>3.Or the second thing is how to get the list of materials start with some alphabate.</i>
I think it will come with acending order....
for more help go through this link
/people/arpit.seth/blog/2005/06/27/rfc-scenario-using-bpm--starter-kit - File to RFC
regards,
Ansar. -
How to print check boxes in output using alv
send me replly immediately
hi
Program Name: ALV ON SECONDARY LISTS Creation: 02/01/2007*
SAP Name : YH634_0102007_ALV_LIST Application: *
Author : P.V.D.Veeresh Babu Type: 1 *
Description : This program is used to display secondary lists using *
ALV. *
Inputs: *
Tables: *
SPFLI - Flight information *
SFLIGHT - Flight *
SBOOK - Flight booking details *
Select options: *
N/A *
Parameters: *
NO *
Outputs: secondary lists with ALV *
External Routines *
Function Modules: *
REUSE_ALV_LIST_DISPLAY *
Transactions : No *
Programs : No *
Return Codes: No *
Ammendments: *
Programmer Date Req. # Action *
================ ========== ====== ==============================*
type-pools: slis.
*" Data declarations...................................................
Data declaration of the structure to hold layout details *
data:
fs_layout type slis_layout_alv.
*" Data declarations...................................................
Data declaration of the structure to hold spfli details *
data: begin of fs_spfli,
color(4) type c, " Color
check type c. " Check box
include structure spfli. " Spfli
data end of fs_spfli.
*" Data declarations...................................................
Data declaration of the structure to hold sflight details *
data:begin of fs_sflight,
color(4) type c, " Color
check type c. " Check box
include structure sflight. " Sflight
data end of fs_sflight.
*" Data declarations...................................................
Data declaration of the structure to hold sbook details *
data:
fs_sbook like sbook.
Internal table to hold list details *
data:
t_sbook like
standard table
of fs_sbook.
Internal table to hold list details *
data:
t_sflight like
standard table
of fs_sflight .
Internal table to hold spfli details *
data:
t_spfli like
standard table
of fs_spfli.
fs_layout-box_fieldname = 'CHECK'.
fs_layout-info_fieldname = 'COLOR'.
"........Retrieving basic list data containing spfli details......."
select *
from spfli
into corresponding fields of table t_spfli.
if sy-subrc ne 0.
message text-001 type 'I'.
endif. " IF SY-SUBRC NE 0
".................Calling function module for ALV..................."
call function 'REUSE_ALV_LIST_DISPLAY'
exporting
i_callback_program = sy-repid
i_callback_pf_status_set = 'STATUS1'
i_callback_user_command = 'USER_COMMAND1'
i_structure_name = 'SPFLI'
is_layout = fs_layout
tables
t_outtab = t_spfli
exceptions
program_error = 1
others = 2.
if sy-subrc <> 0.
message text-002 type 'I'.
endif. " IF SY-SUBRC NE 0
Form STATUS1 *
This subroutine gives pf-status for spfli list *
-->T_EXTAB excluding table *
form status1 using t_extab type slis_t_extab.
set pf-status 'STATUS1'.
endform. " STATUS1
Form USER_COMMAND1 *
This subroutine displays secondary list containing sflight details*
-->FS_UCOMM user command *
-->T_SELFIELD selfield *
form user_command1 using fs_ucomm type sy-ucomm
t_selfield type slis_selfield.
case fs_ucomm.
when 'SFLIGHT'.
perform display_list2.
endcase. " CASE FS_UCOMM
t_selfield-refresh = 'X'.
endform. " USER_COMMAND1
Form DISPLAY_LIST2 *
This subroutine displays sflight details on secondary list *
There are no interface parameters to be passed in this subroutine *
form display_list2 .
data lw_flag type i. " Flag
refresh t_sflight.
loop at t_spfli into fs_spfli.
if fs_spfli-check = 'X'.
"........Retrieving basic list data containing sflight details......."
select *
from sflight
appending corresponding fields of table t_sflight
where carrid eq fs_spfli-carrid
and connid eq fs_spfli-connid.
if sy-subrc eq 0.
lw_flag = 1.
endif. " IF SY-SUBRC EQ 0
FS_SPFLI-CHECK = '0'.
fs_spfli-color = 'C510'.
modify t_spfli from fs_spfli .
endif. " IF FS_SPFLI-CHECK EQ 'X'
endloop. " LOOP AT T_SPFLI INTO FS_SPFLI
if lw_flag eq 0.
message text-003 type 'E'.
endif. " IF LW_FLAG EQ 1
".................Calling function module for ALV..................."
call function 'REUSE_ALV_LIST_DISPLAY'
exporting
i_callback_program = sy-repid
i_callback_pf_status_set = 'STATUS2'
i_callback_user_command = 'USER_COMMAND2'
i_structure_name = 'SFLIGHT'
is_layout = fs_layout
tables
t_outtab = t_sflight
exceptions
program_error = 1
others = 2.
if sy-subrc <> 0.
message text-002 type 'I'.
endif. " IF SY-SUBRC NE 0
endform. " DISPLAY_LIST2
Form STATUS2 *
This subroutine gives pf-status for secondary list. *
-->T_EXTAB Excluding table *
form status2 using t_extab type slis_t_extab.
set pf-status 'STATUS2'.
endform. " STATUS2
Form USER_COMMAND2 *
This subroutine gives secondary list containing sbook details *
-->FS_UCOMM user command *
-->T_SELFIELD selfield *
form user_command2 using fs_ucomm type sy-ucomm
t_selfield type slis_selfield.
case fs_ucomm.
when 'SBOOK'.
perform display_list3.
endcase. " CASE FS_UCOMM
t_selfield-refresh = 'X'.
endform. " USER_COMMAND2
Form DISPLAY_LIST3 *
This subroutine displays sbook details on secondary list *
There are no interface parameters to be passed in this subroutine *
form display_list3 .
data lw_flag type i. " Flag
refresh t_sbook.
loop at t_sflight into fs_sflight.
if fs_sflight-check eq 'X'.
"........Retrieving basic list data containing sbook details......."
select *
from sbook
appending corresponding fields of table t_sbook
where carrid eq fs_sflight-carrid
and connid eq fs_sflight-connid
and fldate eq fs_sflight-fldate.
if sy-subrc eq 0.
lw_flag = 1.
endif. " IF SY-SUBRC EQ 0
FS_SFLIGHT-CHECK = '0'.
fs_sflight-color = 'C910'.
modify t_sflight from fs_sflight.
endif. " IF FS_FLIGHT-CHECK EQ 'X'
endloop. " LOOP AT T_SFLIGHT INTO....
if lw_flag eq 0.
message text-004 type 'E'.
endif. " IF LW_FLAG EQ 1
".................Calling function module for ALV..................."
call function 'REUSE_ALV_LIST_DISPLAY'
exporting
i_structure_name = 'SBOOK'
is_layout = fs_layout
tables
t_outtab = t_sbook
exceptions
program_error = 1
others = 2.
if sy-subrc <> 0.
message text-002 type 'I'.
endif. " IF SY-SUBRC NE 0
endform. " DISPLAY_LIST3
regards,
veeresh
null -
Sublist by using ALV OO can not be refreshed
Hi Gurus,
i met with a very strange problem. i created a interactive list by using ALV OO and if you double click on one of the rows, the screen will go to a sublist which displays the detail information of the row.
My question is every time i chose a row(double click), the program will always display the sublist of the row firstly chosen. For example:
i have a overview list:
10001 Micheal
10002 Tom
10003 Michelle
and the sublist for 10001:
Surname Frank
Givenname Micheal
Age 18
Gender Male
sublist for 10002:
Surname Lee
Givenname Tom
Age 19
Gender Male
sublist for 10003:
Surname Williams
Givenname Michelle
Age 17
Gender Female
at the very beginning, the program is launched, the overlist shall be displayed correctly. then if i double click on 10001, the detail information of Micheal will be displayed in a sublist correctly. after that i go back to the overview list and double click on 10002, the detail information displayed is still for Micheal instead of Tom. and no matter which row is chosen, the detail information displayed will always be :
Surname Frank
Givenname Micheal
Age 18
Gender Male
Here is some of the source code
the main program:
INITIALIZATION.
PERFORM f_init.
AT SELECTION-SCREEN on p_mode.
PERFORM f_screen_change.
START-OF-SELECTION.
PERFORM f_fetch_data.
END-OF-SELECTION.
CALL SCREEN 2000.
The code for event double click:
FORM handle_double_click USING i_row_id TYPE lvc_s_row
i_column_id TYPE lvc_s_col
is_row_no TYPE lvc_s_roid.
REFRESH i_rebate_detail.
READ TABLE i_rebate_header INDEX is_row_no-row_id.
IF sy-subrc EQ 0.
LOOP AT i_rebate_log_detail WHERE vkorg = i_rebate_header-vkorg
AND vtweg = i_rebate_header-vtweg
AND spart = i_rebate_header-spart
AND payer = i_rebate_header-payer.
MOVE-CORRESPONDING i_rebate_log_detail TO i_rebate_detail.
APPEND i_rebate_detail TO i_rebate_detail.
CLEAR i_rebate_detail.
ENDLOOP.
CALL SCREEN 3000.
ENDIF.
ENDFORM . "handle_double_clickThe source code for sublist display:
FORM f_output_detail.
* ALV Grid instance reference
DATA:
gr_alvgrid_detail TYPE REF TO
cl_gui_alv_grid,
* Custom container instance reference
gr_ccontainer_detail TYPE REF TO
cl_gui_custom_container,
* Field catalog table
gt_fieldcat_detail TYPE lvc_t_fcat,
* Layout structure
gs_layout_detail TYPE lvc_s_layo.
IF gr_alvgrid_detail IS INITIAL .
* Creating custom container instance
CREATE OBJECT gr_ccontainer_detail
EXPORTING
container_name = 'ALV_CONTAINER_DETAIL'
EXCEPTIONS
cntl_error = 1
cntl_system_error = 2
create_error = 3
lifetime_error = 4
lifetime_dynpro_dynpro_link = 5
OTHERS = 6.
IF sy-subrc <> 0.
*--Exception handling
ENDIF.
*----Creating ALV Grid instance
CREATE OBJECT gr_alvgrid_detail
EXPORTING
i_parent = gr_ccontainer_detail
EXCEPTIONS
error_cntl_create = 1
error_cntl_init = 2
error_cntl_link = 3
error_dp_create = 4
OTHERS = 5.
IF sy-subrc <> 0.
*--Exception handling
ENDIF.
*----Preparing field catalog.
PERFORM f_field_catalog_detail CHANGING gt_fieldcat_detail.
*----Preparing layout structure
PERFORM f_layout CHANGING gs_layout_detail .
CALL METHOD gr_alvgrid_detail->set_table_for_first_display
EXPORTING
is_layout = gs_layout_detail
CHANGING
it_outtab = i_rebate_detail[]
it_fieldcatalog = gt_fieldcat_detail[]
EXCEPTIONS
invalid_parameter_combination = 1
program_error = 2
too_many_lines = 3
OTHERS = 4 .
IF sy-subrc <> 0.
*--Exception handling
ENDIF.
ELSE .
CALL METHOD gr_alvgrid_detail->refresh_table_display
EXCEPTIONS
finished = 1
OTHERS = 2 .
IF sy-subrc <> 0.
*--Exception handling
ENDIF.
ENDIF.
ENDFORM. " F_OUTPUT -
Display 2 different structured internal tables in single screen using ALV
Hi,
I have two internal tables. Both has different structures. My requirement is to display both the internal tables in single screen using ALV Grid but NOT using OO ALV Grid display.
Is there any way of spliting the Final ALV display screen into two with two different headers and details as shown below.
Header1 for internal table 1
Data of internal table 1
Header1 for internal table 2
Data of internal table 2
Can anyone suggest a better way to display this.
Regards,
Senthilhi
first think i can say ALV GRID means only for OO ALV it is not possible to display two I.T. data in singr report screen.
better to use of the fm: REUSE_ALV_BLOCK_LIST_DISPLAY
so that u can display both I.T. data in separate report list under single screen
Check the example programs:
BALVBT01 Testprogram ALV: Block list
BCALV_TEST_BLOCK_LIST Program BCALV_TEST_BLOCK_LIST
Regards,
deepak -
Stock, Outstanding & Consumption Report for List of Materials
Dear all,
Is there any standard transaction / procedure to get the current stock, outstanding PO (external only) & PRs and the consumption (MvT to be selected by the user) of list of Materials (collective) in the selected Time period and Plants & S Locs.
Thanks & regards,
Sheeja.hi
what u want cant be avalilable at time
u can get all std reports in SAP using t code SAP1
current stock MMBE
outstanding PO (external only) ME2N
PRs ME5A
and the consumption MB5B
http://www.sap-img.com/materials/how-to-get-the-total-stock-consumption-data.htm
http://www.sap123.com/showthread.php?t=398
regards
KI -
Report for list of materials supplying by particular vendor
How to find vendorwise list of materials supplying by him.
Hi
Go to MM03 and in the selection crieteria select MATERIAL BY VENDORS MATERIAL NUMBER and there you give the vendor and the list of materials will be displayed.
This information will be available once you have any purchasing doucments like inforecords, source list, PO, Contracts, SA etc. because you will no where give the vendor while you create a material master. Other way is to link vendor material number to sap generated material number.
You can use ME1M, ME2L
Thanks & Regards,
Kiran. -
Develope a report with out using alv
REPORT OBJECT:
The report to list the material quantities returned because of breakage or expiry date or for any other reason.for material the quantities are summed up
under expiry quantity ,breakage and other quantity for a particular month.
above mentioned is the object of my report .
please help me any one to develop the report with out using ALV'S.Hello Pravardhan
Your requirements are definitely demanding for an ALV list because all the calculations can be done by the user himself without any programming. The only thing you need to do is to collect all necessary data. In addition, all criteria for calculating subtotals/totals (e.g. month) must be available as separate column on the ALV list.
This is reasonable programming, anything else not. If the users have an ALV list they can easily adjust the layout to their specific needs without calling for a developer.
We should always develop our programs with a <b>strong focus on the user's perspective</b>.
Regards
Uwe -
Using ALV function with tables
Hello Everyone,
Can anyone pls explain with an example how to use ALV in unicode to write out a table. Since following statements is porducing error:
write:/T510N, 'T510N was changed'.
it gives uncompatible error. In non unicode system it works fine.
Thanks in advanced.Hi
check this doc regarding Unicode
The Link will be helpful to you.
Re: Upgrade 4.6 to ECC - What are the responsibilites
regarding Unicode influence in Standard programs
Very good document:
http://www.doag.org/pub/docs/sig/sap/2004-03/Buhlinger_Maxi_Version.pdf
https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/d37d1ad9-0b01-0010-ed9f-bc3222312dd8
https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/589d18d9-0b01-0010-ac8a-8a22852061a2
https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/f8e316d9-0b01-0010-8e95-829a58c1511a
You need to use the transaction UCCHECK.
The report documentation is here
ABAP Unicode Scan Tool UCCHECK
You can use transaction UCCHECK to examine a Unicode program set for syntax errors without having to set the program attribute "Unicode checks active" for every individual program. From the list of Unicode syntax errors, you can go directly to the affected programs and remove the errors. It is also possible to automatically create transport requests and set the Unicode program attribute for a program set.
Some application-specific checks, which draw your attention to program points that are not Unicode-compatible, are also integrated.
Selection of Objects:
The program objects can be selected according to object name, object type, author (TADIR), package, and original system. For the Unicode syntax check, only object types for which an independent syntax check can be carried out are appropriate. The following object types are possibilities:
PROG Report
CLAS Class
FUGR Function groups
FUGX Function group (with customer include, customer area)
FUGS Function group (with customer include, SAP area)
LDBA Logical Database
CNTX Context
TYPE Type pool
INTF Interface
Only Examine Programs with Non-Activated Unicode Flag
By default, the system only displays program objects that have not yet set the Unicode attribute. If you want to use UCCHECK to process program objects that have already set the attribute, you can deactivate this option.
Only Objects with TADIR Entry
By default, the system only displays program objects with a TADIR entry. If you want to examine programs that don't have a TADIR entry, for example locally generated programs without a package, you can deactivate this option.
Exclude Packages $*
By default, the system does not display program objects that are in a local, non-transportable package. If you want to examine programs that are in such a package, you can deactivate this option.
Display Modified SAP Programs Also
By default, SAP programs are not checked in customer systems. If you also want to check SAP programs that were modified in a customer system (see transaction SE95), you can activate this option.
Maximum Number of Programs:
To avoid timeouts or unexpectedly long waiting times, the maximum number of program objects is preset to 50. If you want to examine more objects, you must increase the maximum number or run a SAMT scan (general program set processing). The latter also has the advantage that the data is stored persistently. Proceed as follows:
- Call transaction SAMT
- Create task with program RSUNISCAN_FINAL, subroutine SAMT_SEARCH
For further information refer to documentation for transaction SAMT.
Displaying Points that Cannot Be Analyzed Statically
If you choose this option, you get an overview of the program points, where a static check for Unicode syntax errors is not possible. This can be the case if, for example, parameters or field symbols are not typed or you are accessing a field or structure with variable length/offset. At these points the system only tests at runtime whether the code is sufficient for the stricter Unicode tests. If possible, you should assign types to the variables used, otherwise you must check runtime behavior after the Unicode attribute has been set.
To be able to differentiate between your own and foreign code (for example when using standard includes or generated includes), there is a selection option for the includes to be displayed. By default, the system excludes the standard includes of the view maintenance LSVIM* from the display, because they cause a large number of messages that are not relevant for the Unicode conversion. It is recommended that you also exclude the generated function group-specific includes of the view maintenance (usually L<function group name>F00 and L<function group name>I00) from the display.
Similarly to the process in the extended syntax check, you can hide the warning using the pseudo comment ("#EC *).
Applikation-Specific Checks
These checks indicate program points that represent a public interface but are not Unicode-compatible. Under Unicode, the corresponding interfaces change according to the referenced documentation and must be adapted appropriately.
View Maintenance
Parts of the view maintenance generated in older releases are not Unicode-compatible. The relevant parts can be regenerated with a service report.
UPLOAD/DOWNLOAD
The function modules UPLOAD, DOWNLOAD or WS_UPLOAD and WS_DOWNLOAD are obsolete and cannot run under Unicode. Refer to the documentation for these modules to find out which routines serve as replacements.
Regards
Anji -
Hi Folks,
I am trying to use alv grid list display in function module with at user-command event to call specific transaction in my report. But its not working,its going to short dump. when i am doing this fucntionality in report its working fine but i want to do in FM and call this FM in my report. Is it possible to use at user command How to achieve this.
I have one more qsn: i am displaying KUNNR values in internal tab, but i want to avoid leading zero's in itab-kunnr, how to do this.
Thanks in advance.
regards
RajeshHi vijay, I have done necessary changes as u suggested but its again giving short dump. But its working fine if do in report without calling FM, i am sending the code what i written in FM and short dump message. Pls check it and guide me. Many thanks in advance.
I TRIED THE FORM STATUS USING IN THE REPORT AS WELL INSTEAD IN FM. i HAVE CREATED STUTUS WITH NAME STANDARD.
FUNCTION ZFI_DEALER_PROPOSAL.
""Local interface:
*" IMPORTING
*" VALUE(P_LAUFD) LIKE REGUH-LAUFD
*" VALUE(P_LAUFI) LIKE REGUH-LAUFI
*" VALUE(P_XVORL) LIKE REGUH-XVORL
TYPE-POOLS SLIS.
TABLES : REGUH.
CONSTANTS : user_command TYPE slis_formname VALUE 'USER_COMMAND'.
DATA : IT_FIELDCAT TYPE SLIS_T_FIELDCAT_ALV,
WA_FIELDCAT TYPE SLIS_FIELDCAT_ALV.
DATA : T1_EVENTS TYPE SLIS_T_EVENT,
FS1_EVENTS TYPE SLIS_ALV_EVENT.
DATA : I_LAUFD TYPE REGUH-LAUFD,
I_LAUFI TYPE REGUH-LAUFI,
I_XVORL TYPE REGUH-XVORL.
*DATA : ITAB_REGUH LIKE IT_REGUH OCCURS 3.
*DATA : ITAB TYPE REGUH OCCURS 3.
*DATA : BEGIN OF IT_REGUH OCCURS 3,
LAUFD LIKE REGUH-LAUFD,
LAUFI LIKE REGUH-LAUFI,
XVORL LIKE REGUH-XVORL,
VBLNR LIKE REGUH-VBLNR,
KUNNR LIKE REGUH-KUNNR,
NAME1 LIKE REGUH-NAME1,
BNKN1 LIKE REGUH-ZBNKN,
RBETR LIKE REGUH-RBETR,
RPOST LIKE REGUH-RPOST,
ZBNKY LIKE REGUH-ZBNKL,
END OF IT_REGUH.
I_LAUFD = P_LAUFD.
I_LAUFI = P_LAUFI.
I_XVORL = P_XVORL.
SELECT LAUFD LAUFI XVORL VBLNR KUNNR NAME1 BNKN1 RBETR RPOST ZBNKY
INTO TABLE IT_reguh
FROM REGUH
WHERE VBLNR <> ' ' AND LAUFD = I_LAUFD AND LAUFI = I_LAUFI AND XVORL = I_XVORL.
FS1_EVENTS-NAME = 'TOP_OF_PAGE'.
FS1_EVENTS-FORM = 'FORM1'.
APPEND FS1_EVENTS TO T1_EVENTS.
CALL FUNCTION 'REUSE_ALV_COMMENTARY_WRITE'
EXPORTING
IT_LIST_COMMENTARY = T1_COMMENTS
I_LOGO =
I_END_OF_LIST_GRID =
CLEAR WA_FIELDCAT.
WA_FIELDCAT-COL_POS = 1.
WA_FIELDCAT-FIELDNAME = 'LAUFD'.
WA_FIELDCAT-seltext_L = 'RUN DATE'.
wa_fieldcat-key = 'X'.
APPEND WA_FIELDCAT TO IT_FIELDCAT.
CLEAR WA_FIELDCAT.
WA_FIELDCAT-COL_POS = 1.
WA_FIELDCAT-FIELDNAME = 'LAUFI'.
WA_FIELDCAT-seltext_L = 'IDENTIFICATION'.
WA_FIELDCAT-ddictxt = 'L'.
wa_fieldcat-key = 'X'.
APPEND WA_FIELDCAT TO IT_FIELDCAT.
CLEAR WA_FIELDCAT.
WA_FIELDCAT-COL_POS = 1.
WA_FIELDCAT-FIELDNAME = 'XVORL'.
WA_FIELDCAT-seltext_L = 'INDICATOR'.
wa_fieldcat-key = 'X'.
APPEND WA_FIELDCAT TO IT_FIELDCAT.
CLEAR WA_FIELDCAT.
WA_FIELDCAT-COL_POS = 1.
WA_FIELDCAT-FIELDNAME = 'VBLNR'.
WA_FIELDCAT-seltext_L = 'PAYMENT DOC.NO.'.
wa_fieldcat-key = 'X'.
APPEND WA_FIELDCAT TO IT_FIELDCAT.
CLEAR WA_FIELDCAT.
WA_FIELDCAT-COL_POS = 1.
WA_FIELDCAT-FIELDNAME = 'KUNNR'.
WA_FIELDCAT-seltext_L = 'Dealership No.'.
wa_fieldcat-key = 'X'.
APPEND WA_FIELDCAT TO IT_FIELDCAT.
CLEAR WA_FIELDCAT.
WA_FIELDCAT-COL_POS = 1.
WA_FIELDCAT-FIELDNAME = 'NAME1'.
WA_FIELDCAT-seltext_L = 'Dealer Name'.
wa_fieldcat-key = 'X'.
APPEND WA_FIELDCAT TO IT_FIELDCAT.
CLEAR WA_FIELDCAT.
WA_FIELDCAT-COL_POS = 1.
WA_FIELDCAT-FIELDNAME = 'BNKN1'.
WA_FIELDCAT-seltext_L = 'Bank account No.'.
wa_fieldcat-key = 'X'.
APPEND WA_FIELDCAT TO IT_FIELDCAT.
CLEAR WA_FIELDCAT.
WA_FIELDCAT-COL_POS = 1.
WA_FIELDCAT-FIELDNAME = 'RBETR'.
WA_FIELDCAT-seltext_L = 'Local Payment Amount'.
wa_fieldcat-key = 'X'.
APPEND WA_FIELDCAT TO IT_FIELDCAT.
CLEAR WA_FIELDCAT.
WA_FIELDCAT-COL_POS = 1.
WA_FIELDCAT-FIELDNAME = 'RPOST'.
WA_FIELDCAT-seltext_L = 'No of items paid'.
wa_fieldcat-key = 'X'.
APPEND WA_FIELDCAT TO IT_FIELDCAT.
CLEAR WA_FIELDCAT.
WA_FIELDCAT-COL_POS = 1.
WA_FIELDCAT-FIELDNAME = 'ZBNKY'.
WA_FIELDCAT-seltext_L = 'Routing No.'.
wa_fieldcat-key = 'X'.
APPEND WA_FIELDCAT TO IT_FIELDCAT.
CALL FUNCTION 'REUSE_ALV_FIELDCATALOG_MERGE'
EXPORTING
I_PROGRAM_NAME = ''
I_INTERNAL_TABNAME = ''
I_INCLNAME = ''
I_STRUCTURE_NAME = 'IT_REGUH'
CHANGING
CT_FIELDCAT = IT_FIELDCAT.
*CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
EXPORTING
I_CALLBACK_PROGRAM = 'ZFI_DEALER_PROPOSAL'
I_STRUCTURE_NAME =
I_CALLBACK_PF_STATUS_SET = 'STATUS'
I_CALLBACK_USER_COMMAND = user_command
IT_FIELDCAT = IT_FIELDCAT
IT_EVENTS = T1_EVENTS
TABLES
T_OUTTAB = IT_REGUH.
CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
EXPORTING
I_CALLBACK_PROGRAM = 'ZFI_DEALER_PROPOSAL'
I_CALLBACK_PF_STATUS_SET = 'STANDARD'
I_CALLBACK_USER_COMMAND = user_command
I_STRUCTURE_NAME =
IT_FIELDCAT = IT_FIELDCAT
IT_EVENTS = T1_EVENTS
TABLES
T_OUTTAB = IT_REGUH.
ENDFUNCTION.
FORM user_command USING r_ucomm like sy-ucomm
rs_selfield type slis_selfield.
DATA : IT_TEMP LIKE IT_REGUH.
case r_ucomm.
when '&IC1'. "At Line Selection
read table IT_REGUH index rs_selfield-tabindex into IT_TEMP.
CASE RS_SELFIELD-FIELDNAME.
WHEN 'KUNNR'.
set parameter id 'KUN' field IT_TEMP-KUNNR.
CALL TRANSACTION 'FD03' and skip first screen.
ENDCASE.
ENDCASE.
ENDFORM.
FORM STATUS USING P_EXTAB TYPE SLIS_T_EXTAB.
*- Pf status
SET PF-STATUS 'STANDARD' excluding p_extab.
ENDFORM.
Maybe you are looking for
-
FB60 - Credit Note: Baseline Date Determination
Hi Experts At present I have an AP function who use FB60 to post manual Invoices and Credits to Vendors. The issue is that when a Credit is selected (Doc Type: KG) the baseline date and the subsequent due date are not being determined and have to be
-
Hi Gurus, Good day. Please help on below. We have this scenario. whenever purchase order is changed, it must generate IDOC. how can we configure this? thanks in advance..
-
Is the iphone 5 worth buying?
i have heard mixed reviews and i am very warry of the ios 6 because i heard it still crashes a lot, is it worth the 200 bucks?
-
G5 not reading any discs....?
sorry if this has been posted somewhere, but i did not see anything that could possibly solve this problem. i can eject my tray just fine but when i insert a disc (CD, DVD, burned & regular), the drive wont even spin or read it. so obviously nothing
-
Transferred purchases to new computer cannot move things to iPhone
So I bought a Macbook Pro and am trying to transfer my iPhone to that computer as my primary computer now. I have transferred the purchased and authorized the computer but I am still not able to add music to my phone or edit anything in my phone fro