Converting to gorizontal display-urgent
Dear all,
I am displaying the values of material usage monthwise.These are being displayed vertically.Could you please tell me how to display this horizontally.
Also i want to sum up the usage.
Also i want to dispaly the count ,where count is the number of times that material has been used in that given period. i am also posting my code.
currently it is as follows:- (eg)
Material Period Quantity
Material1 02.07 2.000
Material1 04.07 1.000
Material2 05.07 3.000
Material2 08.07 1.000
Material2 09.07 2.000 and so on.....
I want is as follows
Material 02.07 04.07 05.07 08.07 09.07 TOTAL COUNT
Material1 2 1 0 0 0 3 2
Material2 0 0 3 1 2 6 3
(Note:-If u cant see it properly above try executing the code below.Above in horizontal display 2 is the quantity in 02.2007,1 is the quantity in 04.2007 and their total is 3 and since it has been used twice in a period 5 months ,the count is 2.Similary for material2)
*TYPES: BEGIN OF TY_MARC , "Plant Data for Material
MATNR TYPE MARC-MATNR, "Material Number
WERKS TYPE MARC-WERKS, "Plant
END OF TY_MARC .
*TYPES: BEGIN OF TY_MARA ,
MATNR TYPE MARA-MATNR, "Material Number
MTART TYPE MARA-MTART, "Material type
SPART TYPE MARA-SPART, "Division
WERKS TYPE MARC-WERKS, "Plant
END OF TY_MARA .
TYPES: BEGIN OF TY_ZV_OLR3_MARACKT , "Plant Material: Search Help with Short Text
MATNR TYPE MARA-MATNR , "Material Number
WERKS TYPE MARC-WERKS , "Plant
MTART TYPE MARA-MTART , "Material Type
MAKTX TYPE MAKT-MAKTX , "Material Description
SPART TYPE MARA-SPART , "Division
END OF TY_ZV_OLR3_MARACKT .
TYPES: BEGIN OF TY_MBEW , "Material Valuation
MATNR TYPE MBEW-MATNR , "Material Number
BWKEY TYPE MBEW-BWKEY , "Valuation area
BWTAR TYPE MBEW-BWTAR , "Valuation type
VERPR TYPE MBEW-VERPR , "Moving Average Price/Periodic Unit Price
END OF TY_MBEW .
*TYPES: BEGIN OF TY_MKPF , "Header: Material Document
MBLNR TYPE MKPF-MBLNR , "Number of Material Document
MJAHR TYPE MKPF-MJAHR , "Material Document Year
BUDAT TYPE MKPF-BUDAT , "Posting Date in the Document
END OF TY_MKPF .
*TYPES: BEGIN OF TY_MSEG , "Document Segment: Material
MBLNR TYPE MSEG-MBLNR , "Number of Material Document
MJAHR TYPE MSEG-MJAHR , "Document Segment: Material
ZEILE TYPE MSEG-ZEILE , "Item in Material Document
BWART TYPE MSEG-BWART , "Movement Type (Inventory Management)
MENGE TYPE MSEG-MENGE , "Quantity
MEINS TYPE MSEG-MEINS , "Base Unit of Measure
MATNR TYPE MSEG-MATNR , "Material Number
END OF TY_MSEG .
TYPES: BEGIN OF TY_WB2_V_MKPF_MSEG2 , "Data Selection from Material Documents
MBLNR TYPE MSEG-MBLNR , "Number of Material Document
MJAHR TYPE MSEG-MJAHR , "Document Segment: Material
BUDAT TYPE MKPF-BUDAT , "Posting Date in the Document
ZEILE_I TYPE MSEG-ZEILE , "Item in Material Document
BWART_I TYPE MSEG-BWART , "Movement Type (Inventory Management)
MENGE_I TYPE MSEG-MENGE , "Quantity
MEINS_I TYPE MSEG-MEINS , "Base Unit of Measure
MATNR_I TYPE MSEG-MATNR , "Material Number
WERKS_I TYPE MSEG-WERKS , "Plant
END OF TY_WB2_V_MKPF_MSEG2 .
TYPES: BEGIN OF TY_WB2_V_MKPF_MSEG2_COPY , "Copy of Data Selection from Material Documents
MATNR_I TYPE MSEG-MATNR , "Material Number
FYEAR(4) TYPE C , "Fiscal Year
MONTH(2) TYPE C , "Month
BWART_I TYPE MSEG-BWART , "Movement Type (Inventory Management)
MBLNR TYPE MSEG-MBLNR , "Number of Material Document
MJAHR TYPE MSEG-MJAHR , "Document Segment: Material
BUDAT TYPE MKPF-BUDAT , "Posting Date in the Document
ZEILE_I TYPE MSEG-ZEILE , "Item in Material Document
MENGE_I TYPE MSEG-MENGE , "Quantity
MEINS_I TYPE MSEG-MEINS , "Base Unit of Measure
WERKS_I TYPE MSEG-WERKS ,
COUNT TYPE I ,
USAGE TYPE MSEG-MENGE ,
END OF TY_WB2_V_MKPF_MSEG2_COPY .
Internal Tables Begin with IT_
Work Area Begin with WA_ *
*Internal Table Declaration.
*DATA: IT_MARC TYPE STANDARD TABLE OF TY_MARC ,
WA_MARC TYPE TY_MARC .
*DATA: IT_MARA TYPE STANDARD TABLE OF TY_MARA ,
WA_MARA TYPE TY_MARA .
DATA: IT_MATERIAL TYPE STANDARD TABLE OF TY_ZV_OLR3_MARACKT ,
WA_MATERIAL TYPE TY_ZV_OLR3_MARACKT .
DATA: IT_MBEW TYPE STANDARD TABLE OF TY_MBEW ,
WA_MBEW TYPE TY_MBEW .
*DATA: IT_MKPF TYPE STANDARD TABLE OF TY_MKPF ,
WA_MKPF TYPE TY_MKPF .
*DATA: IT_MSEG TYPE STANDARD TABLE OF TY_MSEG ,
WA_MSEG TYPE TY_MSEG .
DATA: IT_VIEW TYPE STANDARD TABLE OF TY_WB2_V_MKPF_MSEG2 ,
WA_VIEW TYPE TY_WB2_V_MKPF_MSEG2 .
DATA: IT_VIEW_COPY TYPE STANDARD TABLE OF TY_WB2_V_MKPF_MSEG2_COPY ,
WA_VIEW_COPY TYPE TY_WB2_V_MKPF_MSEG2_COPY ,
IT_VIEW_TMP TYPE STANDARD TABLE OF TY_WB2_V_MKPF_MSEG2_COPY ,
Data Declaration
Work field declaration - used in program
DATA: W_PERIOD TYPE S031-SPMON.
DATA: W_INDEX TYPE SY-TABIX .
DATA: W_QTY_TOT TYPE MENGE_D .
DATA: TOT_USE_TMP TYPE MENGE_D ,
TOT_USE TYPE MENGE_D ,
W_COUNT TYPE I .
RANGES: RO_DATE FOR SY-DATUM .
Parameters Begin with PR_ *
SELECTION-SCREEN BEGIN OF BLOCK blk1 WITH FRAME TITLE text-001.
PARAMETERS: PR_WERKS TYPE MARC-WERKS OBLIGATORY ,
PR_MTART TYPE MARA-MTART OBLIGATORY ,
PR_SPART TYPE MARA-SPART OBLIGATORY ,
PR_MATNR TYPE MARA-MATNR .
Select Options Begin with SO_ *
SELECT-OPTIONS: SO_SPMON FOR W_PERIOD .
SELECTION-SCREEN END OF BLOCK blk1 .
At selection-screen *
AT SELECTION-SCREEN ON VALUE-REQUEST FOR SO_SPMON-LOW.
PERFORM F4_HELP.
AT SELECTION-SCREEN ON VALUE-REQUEST FOR SO_SPMON-HIGH.
PERFORM F4_HELP.
*& Form F4_HELP
Text-F4 Help for Month
-Taken from standard SAP program RMCS0F0M.
FORM F4_HELP .
DATA: BEGIN OF MF_DYNPFIELDS OCCURS 1 .
INCLUDE STRUCTURE DYNPREAD .
DATA: END OF MF_DYNPFIELDS .
DATA: MF_RETURNCODE LIKE SY-SUBRC ,
MF_MONTH LIKE ISELLIST-MONTH,
MF_HLP_REPID LIKE SY-REPID .
FIELD-SYMBOLS: <MF_FELD> .
*Worth reading screen
GET CURSOR FIELD MF_DYNPFIELDS-FIELDNAME.
APPEND MF_DYNPFIELDS.
MF_HLP_REPID = SY-REPID.
DO 2 TIMES.
CALL FUNCTION 'DYNP_VALUES_READ'
EXPORTING
DYNAME = MF_HLP_REPID
DYNUMB = SY-DYNNR
TABLES
DYNPFIELDS = MF_DYNPFIELDS
EXCEPTIONS
INVALID_ABAPWORKAREA = 01
INVALID_DYNPROFIELD = 02
INVALID_DYNPRONAME = 03
INVALID_DYNPRONUMMER = 04
INVALID_REQUEST = 05
NO_FIELDDESCRIPTION = 06
UNDEFIND_ERROR = 07.
IF SY-SUBRC = 3.
*Current screen is a range image
MF_HLP_REPID = 'SAPLALDB'.
ELSE.
READ TABLE MF_DYNPFIELDS INDEX 1.
*Underscores replaced by Blanks
TRANSLATE MF_DYNPFIELDS-FIELDVALUE USING '_ '.
EXIT.
ENDIF.
ENDDO.
IF SY-SUBRC = 0.
*The internal format conversion
CALL FUNCTION 'CONVERSION_EXIT_PERI_INPUT'
EXPORTING
INPUT = MF_DYNPFIELDS-FIELDVALUE
IMPORTING
OUTPUT = MF_MONTH
EXCEPTIONS
ERROR_MESSAGE = 1.
IF MF_MONTH IS INITIAL.
*Initial month => Proposal value of akt. Date deduced
MF_MONTH = SY-DATLO(6).
ENDIF.
CALL FUNCTION 'POPUP_TO_SELECT_MONTH'
EXPORTING
ACTUAL_MONTH = MF_MONTH
IMPORTING
SELECTED_MONTH = MF_MONTH
RETURN_CODE = MF_RETURNCODE
EXCEPTIONS
FACTORY_CALENDAR_NOT_FOUND = 01
HOLIDAY_CALENDAR_NOT_FOUND = 02
MONTH_NOT_FOUND = 03.
IF SY-SUBRC = 0 AND MF_RETURNCODE = 0.
CALL FUNCTION 'CONVERSION_EXIT_PERI_OUTPUT'
EXPORTING
INPUT = MF_MONTH
IMPORTING
OUTPUT = MF_DYNPFIELDS-FIELDVALUE.
COLLECT MF_DYNPFIELDS.
CALL FUNCTION 'DYNP_VALUES_UPDATE'
EXPORTING
DYNAME = MF_HLP_REPID
DYNUMB = SY-DYNNR
TABLES
DYNPFIELDS = MF_DYNPFIELDS
EXCEPTIONS
INVALID_ABAPWORKAREA = 01
INVALID_DYNPROFIELD = 02
INVALID_DYNPRONAME = 03
INVALID_DYNPRONUMMER = 04
INVALID_REQUEST = 05
NO_FIELDDESCRIPTION = 06
UNDEFIND_ERROR = 07.
ENDIF.
ENDIF.
ENDFORM. " F4_HELP
S T A R T O F S E L E C T I O N *
START-OF-SELECTION .
PERFORM CONVERT_MMYYYY_TO_DDMMYYY.
PERFORM GET_DATA.
*& Form CONVERT_MMYYYY_TO_DDMMYYY
Text-In Selection Screen we give date in MM.YYYY format
This cannot be passed to standard table.
Hence first convert it to DD.MM.YYYY format.
FORM CONVERT_MMYYYY_TO_DDMMYYY .
DATA: LW_VAR TYPE I . "LW-Local Workfield
DATA: LW_DATE1 TYPE SY-DATUM ,
LW_DATE2 TYPE SY-DATUM .
DATA: LW_STR_LOW TYPE STRING,
LW_STR_LOW1 TYPE STRING,
LW_STR_LOW2 TYPE STRING.
DATA: LW_STR_HIGH TYPE STRING,
LW_STR_HIGH1 TYPE STRING,
LW_STR_HIGH2 TYPE STRING.
LW_STR_LOW1 = SO_SPMON-LOW+0(4).
LW_STR_LOW2 = SO_SPMON-LOW+4(2).
CONCATENATE LW_STR_LOW1 LW_STR_LOW2 '01' INTO LW_STR_LOW.
LW_DATE1 = LW_STR_LOW.
*WRITE LW_DATE1.
LW_STR_HIGH1 = SO_SPMON-HIGH+0(4).
LW_STR_HIGH2 = SO_SPMON-HIGH+4(2).
IF LW_STR_HIGH2 = '01' OR
LW_STR_HIGH2 = '03' OR
LW_STR_HIGH2 = '05' OR
LW_STR_HIGH2 = '07' OR
LW_STR_HIGH2 = '08' OR
LW_STR_HIGH2 = '10' OR
LW_STR_HIGH2 = '12'.
CONCATENATE LW_STR_HIGH1 LW_STR_HIGH2 '31' INTO LW_STR_HIGH.
LW_DATE2 = LW_STR_HIGH.
WRITE LW_DATE2.
ELSEIF LW_STR_HIGH2 = '04' OR
LW_STR_HIGH2 = '06' OR
LW_STR_HIGH2 = '09' OR
LW_STR_HIGH2 = '11'.
CONCATENATE LW_STR_HIGH1 LW_STR_HIGH2 '30' INTO LW_STR_HIGH.
LW_DATE2 = LW_STR_HIGH.
WRITE LW_DATE2.
*Logic to check for Leap Year:-
*For all years that are multiples of 100,we need to test if its divisible by 400
*(instead of 4).If yes, then we can be sure that the year is a Leap Year.
ELSEIF LW_STR_HIGH2 = '02'.
*Begin:-To check for Leap Year when February.
LW_VAR = LW_STR_HIGH1 MOD 100.
IF LW_VAR EQ 0.
LW_VAR = LW_STR_HIGH1 MOD 400.
IF LW_VAR EQ 0.
CONCATENATE LW_STR_HIGH1 LW_STR_HIGH2 '29' INTO LW_STR_HIGH.
LW_DATE2 = LW_STR_HIGH.
WRITE LW_DATE2.
ELSE.
CONCATENATE LW_STR_HIGH1 LW_STR_HIGH2 '28' INTO LW_STR_HIGH.
LW_DATE2 = LW_STR_HIGH.
WRITE LW_DATE2.
ENDIF.
ELSEIF LW_VAR NE 0.
LW_VAR = LW_STR_HIGH1 MOD 4.
IF LW_VAR EQ 0.
CONCATENATE LW_STR_HIGH1 LW_STR_HIGH2 '29' INTO LW_STR_HIGH.
LW_DATE2 = LW_STR_HIGH.
WRITE LW_DATE2.
ELSE.
CONCATENATE LW_STR_HIGH1 LW_STR_HIGH2 '28' INTO LW_STR_HIGH.
LW_DATE2 = LW_STR_HIGH.
WRITE LW_DATE2.
ENDIF.
ENDIF.
*End:-To check for Leap Year when February.
ENDIF.
*Since we have low and high dates in two different strings,they directly
*cannot be passed to standard table (MSEG).So we first get them into RO_DATE.
RO_DATE-SIGN = 'I'.
RO_DATE-OPTION = 'BT'.
RO_DATE-LOW = LW_DATE1.
RO_DATE-HIGH = LW_DATE2.
APPEND RO_DATE.
ENDFORM. " CONVERT_MMYYYY_TO_DDMMYYY
*& Form GET_DATA
Text
FORM GET_DATA .
**Select fired on MARC to get only those materials of whose plant has been
**given on Selection Screen.
IF PR_MATNR EQ ''.
SELECT MATNR WERKS
FROM MARC
INTO TABLE IT_MARC
WHERE WERKS EQ PR_WERKS.
ELSE.
SELECT MATNR WERKS
FROM MARC
INTO TABLE IT_MARC
WHERE MATNR EQ PR_MATNR AND
WERKS EQ PR_WERKS.
ENDIF.
**If records are found then get material type and division from MARA for
**materials got from MARC.
IF SY-SUBRC = 0.
SELECT MATNR MTART SPART
FROM MARA
INTO TABLE IT_MARA
FOR ALL ENTRIES IN IT_MARC
WHERE MATNR EQ IT_MARC-MATNR.
ENDIF.
**Filtering out those materials on the basis of material type and division
**that is given on Selection Screen.
LOOP AT IT_MARA INTO WA_MARA.
W_INDEX = SY-TABIX.
IF WA_MARA-MTART NE PR_MTART OR WA_MARA-SPART NE PR_SPART.
DELETE IT_MARA INDEX W_INDEX.
ELSE.
MOVE: PR_WERKS TO WA_MARA-WERKS.
MODIFY IT_MARA FROM WA_MARA TRANSPORTING WERKS.
CLEAR: WA_MARA.
ENDIF.
ENDLOOP.
*Select fired on view ZV_OLR3_MARACKT which results in above 3 steps together
IF PR_MATNR EQ ''.
SELECT MATNR WERKS MTART MAKTX SPART
FROM ZV_OLR3_MARACKT
INTO TABLE IT_MATERIAL
WHERE WERKS EQ PR_WERKS AND
MTART EQ PR_MTART AND
SPART EQ PR_SPART.
ELSE.
SELECT MATNR WERKS MTART MAKTX SPART
FROM ZV_OLR3_MARACKT
INTO TABLE IT_MATERIAL
WHERE MATNR EQ PR_MATNR AND
WERKS EQ PR_WERKS AND
MTART EQ PR_MTART AND
SPART EQ PR_SPART.
ENDIF.
SORT IT_MARA BY MATNR.
SORT IT_MATERIAL BY MATNR.
*Select fired on MBEW to get Rate (VERPR) on basis of material and plant
*in IT_MARA.
SELECT MATNR BWKEY BWTAR VERPR
FROM MBEW
INTO TABLE IT_MBEW
FOR ALL ENTRIES IN IT_MARA
WHERE MATNR EQ IT_MARA-MATNR AND
BWKEY EQ IT_MARA-WERKS.
SELECT MATNR BWKEY BWTAR VERPR
FROM MBEW
INTO TABLE IT_MBEW
FOR ALL ENTRIES IN IT_MATERIAL
WHERE MATNR EQ IT_MATERIAL-MATNR AND
BWKEY EQ IT_MATERIAL-WERKS.
IF SY-SUBRC = 0.
Do Nothing.
ENDIF.
**Select fired on MKPF to get Document Number on basis of period given on
**selection screen.
SELECT MBLNR MJAHR BUDAT
FROM MKPF
INTO TABLE IT_MKPF
WHERE BUDAT IN RO_DATE.
**If records are found then pass Document Number (MBLNR) to MSEG Table.
IF SY-SUBRC = 0.
SELECT MBLNR MJAHR ZEILE BWART MENGE MEINS MATNR
FROM MSEG
INTO TABLE IT_MSEG
FOR ALL ENTRIES IN IT_MKPF
WHERE MBLNR EQ IT_MKPF-MBLNR AND
BWART IN ('261','262','601','602').
SORT IT_MSEG BY BWART MATNR.
ENDIF.
*Select fired on View WB2_V_MKPF_MSEG2 to get required common fields of
*Table MKPF and MSEG.Also above commented coded is thus avoided.
SELECT MBLNR
MJAHR
BUDAT
ZEILE_I
BWART_I
MENGE_I
MEINS_I
MATNR_I
WERKS_I
FROM WB2_V_MKPF_MSEG2
INTO TABLE IT_VIEW
WHERE BUDAT IN RO_DATE AND
BWART_I IN ('261','262','601','602') AND
WERKS_I EQ PR_WERKS.
*If records are found then read table MARA for which existing records
*are moved to copy table.
IF SY-SUBRC EQ 0.
SORT IT_VIEW BY MATNR_I.
LOOP AT IT_VIEW INTO WA_VIEW.
W_INDEX = SY-TABIX.
READ TABLE IT_MARA INTO WA_MARA WITH KEY MATNR = WA_VIEW-MATNR_I.
READ TABLE IT_MATERIAL INTO WA_MATERIAL WITH KEY MATNR = WA_VIEW-MATNR_I.
IF SY-SUBRC NE 0.
DELETE IT_VIEW INDEX W_INDEX.
ELSE.
MOVE-CORRESPONDING: WA_VIEW TO WA_VIEW_COPY.
MOVE: WA_VIEW-BUDAT+0(4) TO WA_VIEW_COPY-FYEAR,
WA_VIEW-BUDAT+4(2) TO WA_VIEW_COPY-MONTH.
APPEND WA_VIEW_COPY TO IT_VIEW_COPY.
CLEAR WA_VIEW_COPY.
ENDIF.
CLEAR: WA_VIEW,WA_MARA.
CLEAR: WA_VIEW,WA_MATERIAL.
ENDLOOP.
ENDIF.
*Sorting on basis of material year and month,processing event will be triggered
*at end of month.
SORT IT_VIEW_COPY BY MATNR_I FYEAR MONTH.
*On basis of movement type (BWART),calculation of exact quantity of material
*used in a particular month.(Processing Event used here)
LOOP AT IT_VIEW_COPY INTO WA_VIEW_COPY.
MOVE WA_VIEW_COPY TO WA_VIEW_TMP.
IF WA_VIEW_COPY-BWART_I = '261' OR WA_VIEW_COPY-BWART_I = '601'.
W_QTY_TOT = W_QTY_TOT + WA_VIEW_COPY-MENGE_I.
ENDIF.
IF WA_VIEW_COPY-BWART_I = '262' OR WA_VIEW_COPY-BWART_I = '602'.
W_QTY_TOT = W_QTY_TOT - WA_VIEW_COPY-MENGE_I.
ENDIF.
AT END OF MONTH.
W_COUNT = W_COUNT + 1.
TOT_USE = TOT_USE + W_QTY_TOT.
MOVE: W_QTY_TOT TO WA_VIEW_TMP-MENGE_I,
W_COUNT TO WA_VIEW_TMP-COUNT .
TOT_USE TO WA_VIEW_TMP-USAGE .
APPEND WA_VIEW_TMP TO IT_VIEW_TMP.
CLEAR: WA_VIEW_TMP,W_QTY_TOT,W_COUNT."TOT_USE.
ENDAT.
CLEAR: WA_VIEW_COPY,WA_VIEW_TMP.
ENDLOOP.
SORT IT_VIEW_TMP BY MATNR_I.
IF PR_MTART EQ 'FERT'.
SELECT MATNR BWKEY BWTAR VERPR
FROM MBEW
INTO TABLE IT_MBEW
FOR ALL ENTRIES IN IT_VIEW_TMP
WHERE MATNR EQ IT_VIEW_TMP-MATNR_I AND
BWTAR EQ 'NEW VEH' AND
BWKEY EQ IT_VIEW_TMP-WERKS_I.
ELSEIF PR_MTART EQ 'HALB'.
SELECT MATNR BWKEY BWTAR VERPR
FROM MBEW
INTO TABLE IT_MBEW
FOR ALL ENTRIES IN IT_VIEW_TMP
WHERE MATNR EQ IT_VIEW_TMP-MATNR_I AND
BWTAR EQ 'M&M' AND
BWKEY EQ IT_VIEW_TMP-WERKS_I.
ELSEIF PR_MTART EQ 'ZHLB'.
SELECT MATNR BWKEY BWTAR VERPR
FROM MBEW
INTO TABLE IT_MBEW
FOR ALL ENTRIES IN IT_VIEW_TMP
WHERE MATNR EQ IT_VIEW_TMP-MATNR_I AND
BWTAR EQ 'LOCAL' AND
BWKEY EQ IT_VIEW_TMP-WERKS_I.
ENDIF.
DATA: STRING TYPE STRING.
IF SY-SUBRC = 0.
SORT IT_MBEW BY MATNR.
WRITE: 20 SY-VLINE,49 SY-VLINE,70 SY-VLINE COLOR 4.
WRITE: 05'MATNR' ,40'PERIOD',60'QUANTITY'.
WRITE:SY-ULINE.
LOOP AT IT_VIEW_TMP INTO WA_VIEW_TMP.
WRITE: 20 SY-VLINE, 49 SY-VLINE,70 SY-VLINE.
CONCATENATE WA_VIEW_TMP-MONTH '.' WA_VIEW_TMP-FYEAR INTO STRING.
TOT_USE_TMP = WA_VIEW_TMP-MENGE_I.
AT END OF MONTH.
TOT_USE = TOT_USE + TOT_USE_TMP.
W_COUNT = W_COUNT + 1.
WRITE: / WA_VIEW_TMP-MATNR_I,STRING,TOT_USE_TMP,W_COUNT.
CLEAR W_COUNT.
ENDAT.
AT END OF MATNR_I.
WRITE: SY-ULINE.
W_COUNT = W_COUNT + 1.
WRITE: / WA_VIEW_TMP-MATNR_I,STRING,TOT_USE,W_COUNT.
CLEAR TOT_USE.
ENDAT.
ENDLOOP.
ENDIF.
Create new db instance with appropriate character set
afterwards use exp imp utility for character set migration.
Regards
Singh
Similar Messages
-
Not sure that I have selected the correct forum. Hope my questions are clearly stated.
Having problems connecting iMac(late 2006) running 10.7.5 to a Samsung Flat Screen TV using separate audio/speaker cable and HDMI standard cable, mini-DVI to HDMI video converter. TV displays generic Apple galaxy background and "some" windows (e.g. screen resolution choices). It does not show Mail or Safari menus. System preferences' display "gathered" the Samsung and chose its resolution. I did not find a way to select the Samsung as my display.
In addition to having old hardware, we have Verizon FIOS providing internet and TV access. Is there any way to make this work for us? We would like to stream video (Netflix) and view shows from the Web. Do we need Apple TV to do this? Or is it not possible with our old iMac? My husband thinks that our Airport could be a factor.
Thank youLately, I have been seeing a lot of posts with users trying to use their Macs/iMacs to mirror their streaming video from their Macs to an HDTV.
There are, actually, many alternatives to choose from than just from a Mac.
You need to have or invest in a WiFi capable router for all of these examples.
Apple TV only integrates with WiFi and newer Mac hardware. So, if you want to have total integrated experience, if you have a 2011 Mac or newer, you might as well pay the $100 for the AppleTV box.
If you have a older Mac, like I have noticed many users do, then you have other options.
If you want to elimate long cable clutter and having your Mac at the mercy of your TV all of the time, you can still use the AppleTV box independently or purchase cheaper alternative media streaming boxes from Roku, Sony, Boxee or any number of electronics manufacturers that now have media streaming boxes and media streaming capability built into DVD/Blu-ray players.
These eliminate long cable clutter by being close to the HDTV where shorter, less expensive cables can be used.
Another alternative for iPad users is to use an iPad with the USB/HDMI video adapter and use your iPad as the streaming box. This ties up your iPad in much the same way as it does with your Mac, but again the iPad can be close to the TV and use minimal cables to the TV.
Another alternative to is to use a combination of an iPad and your Mac to stream content that is only available to stream online from a computer. In this case, you can use a desktop remote app on your iPad and Mac. A good and cheap Desktop Remote app is Splashtop Remote. This allows you to completely connect your iPad remotely, over Wifi, to your iMac desktop. The app streams both video and sound to the iPad which is still connected to your HDTV. The resultant stream video picture will be smaller than the size of your HDTV, but it will still be plenty large enough to watch. Again, if you own a iPad and an Intel Mac, this method also allows minimal cabling to the TV. -
Problem in converting into upper case urgent
hi,
i working on module pool program.
in the initial screen there is two fields one is number one is name.
if i enter the name in the name field it is automatically converting into upper case,
but in this case my select query is not working,how to solve this,i mean i have to take same as it is what i entered.
kindly give me suggestion.it is urgent issue.i have to delever today.
Thanks,
mohan.hi
in the Report to handle like this situation.. we use the extentions to the parameter as LOWER CASE .
parameters p_t type char10 LOWER CASE .
i think in the Module pool also.. we can do this in Properties of the FIELD... once check the Properties of the field... there could be a chance.
hi
<b>there is field <b>checkbox called UPPER/LOWER CASE</b>at the bottom of the properties... if tick this u r porblem will be solved</b>
Please Close this thread.. when u r problem is solved
Reward if Helpful
Regards
Naresh Reddy K
Message was edited by:
Naresh Reddy -
Converting digits from display to tactile vibrations
I would like to get a pulse or pulses for the some output.. i.e. i need to convert digital output (i.e. clock display to tactile display (vibrations)) if the clock or any display, displays 345, then i would have three switches on my module, i switch on the first, and it
will vibrate three times, basically there will be three pulses from the square wave, and current will go through the motor three times vibrating it three times. Same as when i put on the second switch, it
would vibrate 4 times, and then the 3rd switch, it would vibrate 5 times. You can also ask your professor for some help pleaseSorry about my first post guys, The reason its soo wide, and please disregard the part that states
"professor who I can ask for some help please" i felt lazy and decided to cut and paste this question
earlier.. Anyway.. this is my situation.. I have a school project, and I need some help. It has been a
very long time since i used LabVIEW so I am not very familiar with it. I am trying to work on a program
in labview.. or rather trying to create a program on labview that would allow me to read a digital
display as vibrations. I have a DAQ, and I have labview software. the scenario is.. Suppose I have a
clock, or a podometer, I would like to come up with a program and later on a gadget that could convert
the numbers i see on the display as vibrations. for an example: if the display on my podometer reads
121, then on my gadget i would have 3 buttons, and when i'd press the first button, the unit (gadget)
would vibrate once, and then when i would press the second button, it would vibrate twice at regular
short intervals, and when i press the third button, it would vibrate once again. Now I know i have to
use something like a square wave that would give me pulses, ofcourse i'd attach my unit to a vibrating
motor, and the pulses would act as current going through the motor. Please help. once again, I am sorry
for the first post.
Message Edited by MMQ on 04-13-2008 07:08 PM -
Negative sign before amount in report display(urgent)
i have one condititon in a rerport that if
SHKZG is debitor then before that amount no sign means positive
and if it is creditor then a minus sign should come before tha amount in list display.
for example-
if rs 100 is credit then it should display -100 otherwise hundred
depending on SHKZG field which is creditor or debitor field .so depending on it only it has to display like above.
plz its urgent .hi sanjeev,
welcome to sdn!!!
data : l_amt(15) value '435.46-'.
CALL FUNCTION 'CLOI_PUT_SIGN_IN_FRONT'
CHANGING
VALUE = l_amt.
write : l_amt.
reward if helpful -
Vector art converted to symbol displays incorrect in PDF?
Is there a known issue with symbols not displaying correctly in a PDF? I often convert grouped elements or logos to a symbol so that I can edit the symbol later and all instances of it being used in a doc will be revised. Saves a lot of time. I made this red box and type and made it a symbol. Now, when I make a PDF there is a phantom piece of type that should not be there. It does not happen on all instances. I checked the file in keyline mode. The phantom type is not there. Any ideas? Thanks.
Does the art have another fill or does it have an effect on different fill?
Is it point type? Perhaps outlining it will make it right unless this will have to be updated which it does not look like it will be. -
Adobe 7.X DNG converter won't display "action buttons" at botton
Hello,
I have a new camera and upgraded to Adobe Digital negative converter ver. 7.3 to support it. Oddest thing. It cuts off the bottom. The "action buttons" [about DNG converter] [extract] [convert] or [exit] buttons at the bottom soI cant execute the program. (see below) I've also tried Ver 7.2. Same issue. Ver 6.2 works fine.
Has anyone had this issue. Any known fix?
I'm on Win7 w/ 1080p displays. I've tried different display settings.
Please help if you can.
Thanks and regards,
GuyHave you tried setting your monitor display to native resolution?
-
hi,
I'm currently doing a project which requires me to generate a svg scatterplot graph. I already got data stored in vector.(in a servlet).But heard from my supervisor that i need to convert my data to xml format.With this xml format, i can generate a svg graph.I'm totally new to xml n don't know how to convert from java to xml..Though i read up on articles, i still can't get the idea of it. My data isnt very big. for graph i need to generate a x-axis :green , y-axis:red... n then retrieve the data n plot the scatterplot graph... can somebody help me??? very urgent... thanksOne quick way is to construct the XML your self.
e.g.
StringBuffer xml = new StringBuffer("<?xml version="1.0" encoding="ISO-8859-1"?>");
xml.append("<ROOT>");
while(has more elements) {
xml.append("<ELEMENT>").append(data).append("</ELEMENT>");
xml.append("</ROOT>");
Rene -
Appraisals - BAdi calcuation display (urgent)
Hello Experts,
I have created a new BAdi for final result for Value determination. I have assigned it at Criteria group level but even after the completion, the value is not displayed. However, it is calculating properly at the backend and pushing to the relevant column. I have put a breakpoint and it is triggering..so I am able to view the calculation.
Please let me know if there is any linkage/I have to do change any configuration in the front end so that it is displayed.
Its very urgent..Please help on this.
Thanks in advance!
SwethaDear Swetha,
I suppose you have assigned standard BAdI name for your BAdI. Try to change the name of the implentation of the BAdI. That should do the job.
Do reward points if the answer is helpful.
Regards,
AXE -
Sold-to-party Text data not getting displayed; Urgent
I am current using a BI content 0CRM_COMP which contains sold-to-party, i have loaded this ODS, but when i view the data in bex i could only see the Key value and not the Text, even though i change the display mode to Key and Text both the columns displays only the Key value. is it because the master data is not loaded, i have also tried to load the Business Partner master data attributes and text till no use. Please help
Note: These business partners are created in CRM and are nor from R/3Hi,
Just check whether for this infoobject has master data and text option ticked or not in infoobject.
If text option in there then search for the data scource0CRM_SOLDTO_TEXT or something like that which contain text for this particular infoobject and then laod the text for the same.
Just got to the modelling tab -> infoprovider-> Application component in which you infoobject is present-> right click insert object as dat target-> give the name of your object this will give you data target one for master data one for text->activate data source and replicate in BW if not presen in BW-> make infosource on the text data source->make update rules for the text target and load.
Or as Anil said sold to party is reference to customer load text into the custome with the same method iot will work fine.
Hope it helps
Thanks -
Header is not coming in alv list display- urgent
hi all,
i am sending my code below....
my requirement is in selection screen i have 4 radio buttons . if i click 1 radio button it will duiisplay data and and its header. report is working fine. my requirement id when i click r_mssng radio button(missing radio button) it is showing data correctsly. here i want to show header as 'Missing details report'.
this is not coming in my report. anybody can suggest me.
i am sending my code below....
report zvra0001ftb13 message-id zv.
Confidential and Proprietary
* Celestica Corporation
* All Rights Reserved
*ABAP Name: ZVRA0001FTB13
*Created by: Srinivasa Chakravarthi
*Created on: 26/03/2003
*SAP Version: 4.6 C
*Description: This report displays details of foreign trades
and EHS based on the deliveries made to the outside
countries.
*Input: Selection Screen Criteria includes country of
origin,Company code, Sales Organisation,
Ship-to-party, Sold-to-paarty, Goods movement date,
Invoice number, Invoice type, Material , Material
Type, Exporter ID, Province of origin.
*Output: ALV output that contains Mode of Transport, Export
HS number, Commodity Description, Quantity, UOM,
Value, Country of Destination, Goods Origin
*Dependency: Nil
*Modification Log:
*CR# Date Coded Transport Description
*====== ======== ========= ============= ===============================
*5147 26/03/2003 Srinivas ED1K922286 New Development
*8700 02/11/2004 H.Arular ED1K938380 To check if entries of Comm
Code(HS code)is less than 8
digits and give a warning
message.
*18684 25/07/2007 MAHEEDHAR Merge the logic from report
ZVRA0001FTB13_ERROR into
report ZVRA0001FTB13 and
added two radio buttons
called missing data and non
missing data, addedc logic
accoriding to the radio
buttons.
*Declaring Tables.
tables: likp, "Delivery document Header
lips, "Delivery Document Item
vbfa, "Sales document Flow
bkpf, "Accounting Document Header
eikp, "Foreign Trade:Export/Import Data
eipo, "Foreign Trade:Export/ Import
"Header data
t618t, "Forein Trade:Mode of Transport
"Description
t604t, "Foreign Trade: Commodity Code/
"Import Code number Description.
mara, "Material master data.
t005, "Countries
t001, "Company Codes
tvko, "Sales Organisations
kna1, "Customer Master
t003, "Document types
t134, "Material types
tvfk,
konv,
vbrk.
constants : c_rep like vbrk-fkart value 'YGFB',
c_for(10) value 'Foreign'.
*Decalre Type pool for ALV
type-pools: slis.
*Type declaration for LIKP.
types: begin of t_data1,
vbeln like likp-vbeln, "Delivery
kunnr like likp-kunnr,
end of t_data1.
*Type declaration for LIPS,VBFA.
types: begin of t_data2,
vbeln like lips-vbeln, "Delivery
posnr like lips-posnr, "Delivery Item
vbelv like vbfa-vbelv, "Preceding SD document
posnv like vbfa-posnv, "Preceding item of SD document
matnr like lips-matnr, "Material Number
meins like lips-meins, "Base unit of measure
lfimg like lips-lfimg, "Actual Quantity Delivered
mtart like mara-mtart,
end of t_data2.
**Type declaration for BKPF.
*types: begin of t_data3,
belnr like bkpf-belnr, "Accounting Documnet number
bukrs like bkpf-bukrs, "Company Code
end of t_data3.
*Type declaration for BKPF.
types: begin of t_data3,
vbeln like vbrk-belnr, " Billing Doc
fkart like vbrk-fkart,
land1 like vbrk-land1,
end of t_data3.
*Type declaration for EIPO.
types: begin of t_data4,
vbeln like lips-vbeln, "Delivery
posnr like lips-posnr, "Delivery Item
matnr like vbrp-matnr,
fkimg like vbrp-fkimg,
meins like vbrp-meins,
verld like eipo-verld, "Country of dispatch for Foreign
"trade
herkl like eipo-herkl, "Country of origin of material
grwrt like eipo-grwrt, "Statistical value for Foreign
" trade
stawn like eipo-stawn, "Commodity code for foreign trade
expvz like eikp-expvz, "Mode of transport for foreign
"trade
end of t_data4.
*Type declaration for T618T.
types: begin of t_data5,
land1 like t618t-land1, "Country key
expvz like t618t-expvz, "Mode of Transport
bezei like t618t-bezei, "Description
end of t_data5.
*Type declaration for T604T.
types: begin of t_data6,
land1 like t604t-land1, "Country key
stawn like t604t-stawn, "Commodity Code
text1 like t604t-text1, "Description
end of t_data6.
*Type declaration for T604T.
types: begin of t_mara,
matnr like mara-matnr,
end of t_mara.
types : begin of rep_val,
vbelv like vbfa-vbelv,
posnv like vbfa-posnv,
vbeln like vbfa-vbeln,
posnn like vbfa-posnn,
uepos like vbap-uepos,
posnr like vbap-posnr,
netwr like vbap-netwr,
end of rep_val.
types : begin of t_price,
vbeln like vbak-vbeln,
posnr like vbap-posnr,
knumv like konv-knumv,
kposn like konv-kposn,
kbetr like konv-kbetr,
kpein like konv-kpein,
end of t_price.
data : t_sord type rep_val occurs 0 with header line.
data : t_dord type rep_val occurs 0 with header line.
data : t_rord type rep_val occurs 0 with header line.
data : t_hord type rep_val occurs 0 with header line.
data : t_ford type rep_val occurs 0 with header line.
data : i_price type t_price occurs 0 with header line.
data : i_price1 type t_price occurs 0 with header line.
data : i_mara type t_mara occurs 0 with header line.
data : i_sort type slis_t_sortinfo_alv.
DATA: t_layout TYPE slis_layout_alv.
*Declaring Selection screen.
selection-screen begin of block b1 with frame title text-101.
select-options:
s_verld for eipo-verld, "Country of Dest.
s_bukrs for bkpf-bukrs, "Company code
s_vkorg for likp-vkorg, "Sales Organisation
s_kunnr for likp-kunnr, "Ship-to-Party
s_kunag for likp-kunag, "Sold-to-party
s_wadat for likp-wadat_ist, "Goods Movement date
s_belnr for vbrk-vbeln, "Invoice number
s_blart for vbrk-fkart. "Invoice type.
selection-screen end of block b1.
selection-screen begin of block b2 with frame title text-101.
select-options:
s_matnr for mara-matnr, "Material
s_mtart for mara-mtart. "Material Type
selection-screen end of block b2.
selection-screen begin of block b3 with frame title text-101.
parameters:
p_export(30) type c default '1366770724RM' obligatory , "Exporter ID
p_provi(30) type c default 'ONTARIO' obligatory ,
p_sumid(30) type c default 'SUM0704'.
"Province of Origin
selection-screen end of block b3.
selection-screen begin of block b4 with frame title text-104.
parameters:
r_summ radiobutton group zsum,
r_dets radiobutton group zsum,
r_mssng radiobutton group zsum, " maheedhar
R_NMSNG RADIOBUTTON GROUP ZSUM. " MAHEEDHAR
selection-screen skip.
parameter : p_sum as checkbox .
selection-screen end of block b4.
selection-screen begin of block b5 with frame title text-105.
select-options : s_i_kun for likp-kunnr.
selection-screen end of block b5.
*Data Declaration
data: i_fieldcat type slis_t_fieldcat_alv.
data: l_fieldcat type slis_fieldcat_alv .
data: v_lin type i.
data: v_lfstk type c value 'C'.
data: v_vbtyp type c value 'U'.
data: i_data1 type t_data1 occurs 0 with header line.
data : begin of t_T005t occurs 0.
include structure t005t.
data : end of t_t005t.
data: i_data2 type t_data2 occurs 0 with header line.
data: t_delv type t_data2 occurs 0 with header line.
data: t_bild type t_data2 occurs 0 with header line.
data: i_data3 type t_data3 occurs 0 with header line.
data: i_data4 type t_data4 occurs 0 with header line.
data: i_data5 type t_data5 occurs 0 with header line.
data: i_data6 type t_data6 occurs 0 with header line.
*Declare Internal table for ALV output.
data: begin of i_output occurs 0,
belnr like vbrk-vbeln,
posnr like vbrp-posnr,
bezei like t618t-bezei,
stawn like eipo-stawn,
text1 like t604t-text1,
quantity type p decimals 2,
meins like lips-meins,
value type p decimals 2,
verld like t_t005t-landx,
herkl like t_t005t-landx,
strlen, "ED1K938380
end of i_output.
maheedhar-start.
data : i_output1 like i_output occurs 0 with header line,
i_output2 like i_output occurs 0 with header line.
maheedhar-end
data : buff_out like i_output occurs 0 with header line.
data: begin of t_outsum occurs 0,
bezei like t618t-bezei,
stawn like eipo-stawn,
text1 like t604t-text1,
quantity type p decimals 2,
meins like lips-meins,
value type p decimals 2,
verld like t_t005t-landx,
herkl like t_t005t-landx,
end of t_outsum.
data : v_ans.
data : variante LIKE disvariant.
data : v_repid LIKE sy-repid.
data : wa_listheader TYPE slis_listheader.
data : t_listheader TYPE slis_t_listheader.
data : b_text(250).
data: evntS type slis_t_event with header line. " MAHEEDHAR
EVENT AT SELECTION-SCREEN
at selection-screen.
*For Autorisation check
perform authorisation_check.
Validation of Selection screen
perform check_entry.
EVENT START-OF-SELECTION
start-of-selection.
*Get data
perform select_data.
**For calling ALV function modules
MAHEEDHAR - START
if r_mssng eq 'X'.
DELETE I_OUTPUT WHERE BEZEI NE SPACE AND
STAWN NE SPACE AND
HERKL NE SPACE AND
VERLD NE SPACE.
DESCRIBE TABLE I_OUTPUT LINES V_LIN.
IF V_LIN > 0.
PERFORM DISPLAY_OUTPUT.
ELSE.
MESSAGE E000 WITH TEXT-130.
ENDIF.
elseif R_SUMM eq 'X' OR R_DETS EQ 'X'. "ENDIF. " MAHEEDHAR
MAHEEDHAR-END
describe table i_output lines v_lin.
if v_lin > 0.
buff_out[] = i_output[].
Begin of ED1K938380
delete buff_out where stawn ne space or "ED1K938380
verld eq space or
herkl eq space.
delete buff_out where strlen ne 'X' or
verld eq space or
herkl eq space.
End of ED1K938380
describe table buff_out lines v_lin.
Lines with no commodity code exists.
if v_lin gt 0.
concatenate text-902 text-903 into b_text.
concatenate text-906 text-907 into b_text. "ED1K938380
CALL FUNCTION 'POPUP_TO_CONFIRM'
EXPORTING
TITLEBAR = Text-901
TEXT_QUESTION = b_text
TEXT_BUTTON_1 = 'Yes'
TEXT_BUTTON_2 = 'No'
DEFAULT_BUTTON = '2'
IMPORTING
ANSWER = v_ans.
if v_ans eq '1'.
perform display_output.
endif.
else.
perform display_output.
endif.
else. " MAHEEDHAR
message e000 with text-130.
endif.
MAHEEDHAR-START
*"-- If non missing details radiobutton is selected
elseif r_nmsng = 'X'.
*"-- move data from i_output to i_output1.
i_output1[] = i_output[].
sort i_output by belnr.
sort i_output1 by belnr.
*"-- to get missing data
delete i_output1 where bezei ne space and
stawn ne space and
herkl ne space and
verld ne space.
loop at i_output.
*"-- compare two int tables with respective document number
read table i_output1 with key belnr = i_output-belnr.
if sy-subrc ne 0.
move-corresponding i_output to i_output2.
append i_output2.
clear i_output2.
endif.
endloop.
describe table i_output2 lines v_lin.
if v_lin gt 0.
perform display_output.
else.
message e000 with text-130.
endif.
MAHEEDHAR-END.
ENDIF. " MAHEEDHAR
FORM SELECT_DATA *
form select_data.
Data:l_strlen type i. "ED1K938380
*Get details from LIKP.
if s_i_kun[] is initial.
select likpvbeln likpkunnr
into corresponding fields of table i_data1
from likp
inner join vbuk on likpvbeln = vbukvbeln
where
likp~vkorg in s_vkorg and
likp~kunnr in s_kunnr and
likp~kunag in s_kunag and
likp~wadat_ist in s_wadat and
vbuk~wbstk = 'C' .
else.
select likpvbeln likpkunnr
into corresponding fields of table i_data1
from likp
inner join vbuk on likpvbeln = vbukvbeln
where
( ( likp~vkorg in s_vkorg and
likp~kunnr in s_kunnr and
likp~kunag in s_kunag and
likp~wadat_ist in s_wadat and
vbuk~wbstk = 'C' )
or
likp~kunnr in s_i_kun and
likp~wadat_ist in s_wadat and
vbuk~wbstk = 'C' ) .
endif.
if sy-subrc ne 0.
message e000 with text-200.
endif.
*Get details from table LIPS
select lips~vbeln
lips~posnr
vbfa~vbeln
vbfa~posnn
lips~matnr
lips~meins
lips~lfimg
mara~mtart
from lips
inner join vbfa on vbfavbelv = lipsvbeln
and vbfaposnv = lipsposnr
inner join mara on maramatnr = lipsmatnr
into table i_data2
for all entries in i_data1
where
lips~vbeln = i_data1-vbeln and
lips~matnr in s_matnr and
vbfa~vbeln in s_belnr and
mara~mtart in s_mtart and
vbfa~vbtyp_n = 'U'.
if sy-subrc ne 0.
message e000 with text-201.
endif.
t_delv[] = i_data2[].
t_bild[] = i_data2[].
sort t_delv by vbeln.
delete adjacent duplicates from t_delv comparing vbeln.
sort t_bild by vbeln ascending vbelv descending.
delete adjacent duplicates from t_bild comparing vbeln.
*Get details of Accounting document number
select vbeln fkart land1 from vbrk
into table i_data3
for all entries in t_bild
where vbeln = t_bild-vbelv and
bukrs in s_bukrs and
fkart in s_blart and
vkorg in s_vkorg and " MAHEEDHAR
land1 in s_verld. " MAHEEDHAR
sort i_data3.
*Get details from EIPO.
select vbrp~vbeln
vbrp~posnr
vbrp~matnr
vbrp~fkimg
vbrp~meins
eipo~verld
eipo~herkl
eipo~grwrt
eipo~stawn
eikp~expvz
from eikp
inner join vbrp on vbrp~vbeln = eikp~refnr
inner join eipo on eikp~exnum = eipo~exnum
and eipo~expos = vbrp~posnr
into table i_data4 for all entries in i_data3
where vbrp~vbeln = i_data3-vbeln.
eipo~verld in s_verld.
if sy-subrc ne 0.
message e000 with text-201.
endif.
IF R_MSSNG NE 'X' or r_nmsng = 'X'. " MAHEEDHAR
perform get_price.
ENDIF. " MAHEEDHAR
Get details from T618T.
select land1
expvz
bezei
from t618t
into table i_data5
for all entries in i_data4
where
land1 = 'CA' and " Getting for Canada only
expvz = i_data4-expvz and
spras = sy-langu.
select matnr from mara into table i_mara where matnr in s_matnr
and mtart in s_mtart.
Get details from T604T.
select land1
stawn
text1
from t604t
into table i_data6
for all entries in i_data4
where
land1 = i_data4-VERLD and
stawn = i_data4-stawn and
spras = sy-langu.
select * from T005t into table t_T005t where spras = sy-langu.
loop at i_data3.
loop at i_data4 where vbeln eq i_data3-vbeln.
clear : i_data1, i_data2.
read table i_data2 with key vbelv = i_data4-vbeln
posnv = i_data4-posnr.
read table i_data1 with key vbeln = i_data2-vbeln.
if not s_i_kun[] is initial.
check ( ( i_data1-kunnr in s_i_kun ) or
( i_data3-land1 in s_verld ) ).
else.
check i_data3-land1 in s_verld .
endif.
read table i_mara with key matnr = i_data4-matnr.
if sy-subrc eq 0.
read table i_data5 with key expvz = i_data4-expvz .
land1 = i_data3-land1.
read table i_data6 with key stawn = i_data4-stawn
land1 = i_data4-VERLD.
move i_data4-vbeln to i_output-belnr.
move i_data4-posnr to i_output-posnr.
move i_data5-bezei to i_output-bezei.
move i_data6-text1 to i_output-text1.
Begin of ED1K938380.
l_strlen = strlen( i_data4-stawn ).
if l_strlen < 8.
move 'X' to i_output-strlen.
endif.
End of ED1K938380.
move i_data4-stawn to i_output-stawn.
move i_data4-meins to i_output-meins.
read table t_T005t with key land1 = i_data3-land1.
move t_t005t-landx to i_output-verld.
if p_sum eq space.
if i_data4-herkl ne 'CA'.
i_output-herkl = c_for.
else.
read table t_T005t with key land1 = i_data4-herkl.
move t_t005t-landx to i_output-herkl.
endif.
else.
read table t_T005t with key land1 = i_data4-herkl.
move t_t005t-landx to i_output-herkl.
endif.
move i_data4-fkimg to i_output-quantity.
if i_data3-fkart eq c_rep.
read table t_dord with key vbeln = i_data4-vbeln
posnn = i_data4-posnr.
if sy-subrc eq 0.
read table t_sord with key vbeln = t_dord-vbelv
posnn = t_dord-posnv.
if sy-subrc eq 0.
read table t_hord with key vbeln = t_sord-vbelv
posnr = t_sord-posnv.
if sy-subrc eq 0.
read table t_ford with key vbeln = t_hord-vbeln
posnr = t_hord-uepos.
if sy-subrc eq 0.
read table i_price with key vbeln = t_ford-vbeln
posnr = t_ford-posnr.
if sy-subrc eq 0.
read table i_price1 with key knumv = i_price-knumv
kposn = t_ford-posnr.
if sy-subrc eq 0.
if i_price1-kpein ne 0.
i_output-value =
( i_price1-kbetr / i_price1-kpein ) *
i_data4-fkimg.
endif.
endif.
endif.
endif.
endif.
endif.
endif.
else.
move i_data4-grwrt to i_output-value.
endif.
append i_output.
clear i_output.
clear : i_data5, i_data6.
endif.
endloop.
endloop.
sort i_output by verld herkl bezei stawn.
endform.
FORM DISPLAY_OUTPUT *
This form is to create the ALV output
form display_output.
data: xevents type slis_t_event,
ls_event type slis_alv_event,
slis_ev_top_of_page type slis_formname value 'TOP_OF_PAGE',
slis_ev_end_of_list type slis_formname value 'END_OF_LIST'.
*Call Function 'REUSE_ALV_EVENTS' for top of page
call function 'REUSE_ALV_EVENTS_GET'
EXPORTING
i_list_type = 0
IMPORTING
et_events = xevents
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 xevents with key name = slis_ev_top_of_page
into ls_event.
if sy-subrc = 0.
move slis_ev_top_of_page to ls_event-form.
append ls_event to xevents.
endif.
read table xevents with key name = slis_ev_end_of_list
into ls_event.
if sy-subrc = 0.
move slis_ev_end_of_list to ls_event-form.
append ls_event to xevents.
endif.
if r_dets ne space.
*Call Function 'REUSE_ALV_FIELD_CATALOG_MERGE' for position fixing in
*the output.
call function 'REUSE_ALV_FIELDCATALOG_MERGE'
exporting
i_program_name = 'ZVRA0001FTB13'
i_internal_tabname = 'I_OUTPUT'
i_inclname = 'ZVRA0001FTB13'
I_STRUCTURE_NAME =
I_CLIENT_NEVER_DISPLAY = 'X'
I_INCLNAME =
i_bypassing_buffer = 'X'
i_buffer_active = ' '
changing
ct_fieldcat = i_fieldcat
exceptions
inconsistent_interface = 1
program_error = 2
others = 3.
if sy-subrc <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
endif.
loop at i_fieldcat into l_fieldcat.
l_fieldcat-key = ' '.
case l_fieldcat-fieldname.
when 'BELNR'.
l_fieldcat-seltext_m = text-912.
l_fieldcat-seltext_l = text-912.
l_fieldcat-reptext_ddic = text-912.
l_fieldcat-col_pos = '1'.
l_fieldcat-just = 'C'.
l_fieldcat-outputlen = '12'..
when 'POSNR'.
l_fieldcat-seltext_m = text-913.
l_fieldcat-seltext_l = text-913.
l_fieldcat-reptext_ddic = text-913.
l_fieldcat-col_pos = '2'.
l_fieldcat-just = 'C'.
l_fieldcat-outputlen = '6'.
when 'BEZEI'.
l_fieldcat-seltext_m = text-911.
l_fieldcat-seltext_l = text-911.
l_fieldcat-reptext_ddic = text-911.
l_fieldcat-col_pos = '3'.
l_fieldcat-just = 'C'.
l_fieldcat-outputlen = '15'..
when 'STAWN'.
l_fieldcat-seltext_m = text-111.
l_fieldcat-seltext_l = text-111.
l_fieldcat-reptext_ddic = text-111.
l_fieldcat-col_pos = '4'.
l_fieldcat-just = 'C'.
l_fieldcat-outputlen = '30'.
when 'TEXT1'.
l_fieldcat-seltext_m = text-112.
l_fieldcat-seltext_l = text-112.
l_fieldcat-outputlen = '40'.
l_fieldcat-col_pos = '5'.
l_fieldcat-just = 'C'.
l_fieldcat-reptext_ddic = text-112.
when 'QUANTITY'.
l_fieldcat-outputlen = '18'.
l_fieldcat-reptext_ddic = text-113.
l_fieldcat-seltext_m = text-113.
l_fieldcat-col_pos = '6'.
l_fieldcat-just = 'C'.
l_fieldcat-seltext_l = text-113.
when 'MEINS'.
l_fieldcat-outputlen = '8'.
l_fieldcat-reptext_ddic = text-114.
l_fieldcat-seltext_m = text-114.
l_fieldcat-col_pos = '7'.
l_fieldcat-just = 'C'.
l_fieldcat-seltext_l = text-114.
when 'VALUE'.
l_fieldcat-outputlen = '20'.
l_fieldcat-seltext_m = text-115.
l_fieldcat-seltext_l = text-115.
l_fieldcat-just = 'C'.
l_fieldcat-reptext_ddic = text-115.
when 'VERLD'.
l_fieldcat-outputlen = '20'.
l_fieldcat-seltext_m = text-116.
l_fieldcat-seltext_l = text-116.
l_fieldcat-just = 'C'.
l_fieldcat-reptext_ddic = text-116.
when 'HERKL'.
l_fieldcat-seltext_m = text-117.
l_fieldcat-seltext_l = text-117.
l_fieldcat-outputlen = '30'.
l_fieldcat-just = 'C'.
l_fieldcat-reptext_ddic = text-117.
when others.
l_fieldcat-no_out = 'X'.
endcase.
modify i_fieldcat from l_fieldcat.
endloop.
Call Function 'REUSE_ALV_LIST_DISPLAY' for dispaly of data in ALV.
call function 'REUSE_ALV_LIST_DISPLAY'
EXPORTING
i_callback_program = 'ZVRA0001FTB13'
it_fieldcat = i_fieldcat
it_events = xevents
is_layout = t_layout
i_save = 'A'
i_bypassing_buffer = 'X'
i_buffer_active = ' '
TABLES
t_outtab = i_output
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.
else. " MAHEEDHAR
ELSEIF R_SUMM EQ 'X'. " MAHEEDHAR
sort i_output by verld herkl stawn bezei.
loop at i_output.
move-corresponding i_output to t_outsum.
collect t_outsum.
endloop.
*Call Function 'REUSE_ALV_FIELD_CATALOG_MERGE' for position fixing in
*the output.
call function 'REUSE_ALV_FIELDCATALOG_MERGE'
EXPORTING
i_program_name = 'ZVRA0001FTB13'
i_internal_tabname = 'T_OUTSUM'
i_inclname = 'ZVRA0001FTB13'
i_bypassing_buffer = 'X'
i_buffer_active = ' '
CHANGING
ct_fieldcat = i_fieldcat
EXCEPTIONS
inconsistent_interface = 1
program_error = 2
others = 3.
if sy-subrc <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
endif.
loop at i_fieldcat into l_fieldcat.
l_fieldcat-key = ' '.
case l_fieldcat-fieldname.
when 'BEZEI'.
l_fieldcat-seltext_m = text-911.
l_fieldcat-seltext_l = text-911.
l_fieldcat-reptext_ddic = text-911.
l_fieldcat-col_pos = '1'.
l_fieldcat-just = 'C'.
l_fieldcat-outputlen = '15'..
when 'STAWN'.
l_fieldcat-seltext_m = text-111.
l_fieldcat-seltext_l = text-111.
l_fieldcat-reptext_ddic = text-111.
l_fieldcat-col_pos = '2'.
l_fieldcat-just = 'C'.
l_fieldcat-outputlen = '30'.
when 'TEXT1'.
l_fieldcat-seltext_m = text-112.
l_fieldcat-seltext_l = text-112.
l_fieldcat-outputlen = '40'.
l_fieldcat-col_pos = '3'.
l_fieldcat-just = 'C'.
l_fieldcat-reptext_ddic = text-112.
when 'QUANTITY'.
l_fieldcat-outputlen = '18'.
l_fieldcat-reptext_ddic = text-113.
l_fieldcat-seltext_m = text-113.
l_fieldcat-col_pos = '4'.
l_fieldcat-just = 'C'.
l_fieldcat-seltext_l = text-113.
when 'MEINS'.
l_fieldcat-outputlen = '8'.
l_fieldcat-reptext_ddic = text-114.
l_fieldcat-seltext_m = text-114.
l_fieldcat-col_pos = '5'.
l_fieldcat-just = 'C'.
l_fieldcat-seltext_l = text-114.
when 'VALUE'.
l_fieldcat-outputlen = '20'.
l_fieldcat-seltext_m = text-115.
l_fieldcat-seltext_l = text-115.
l_fieldcat-col_pos = '6'.
l_fieldcat-just = 'C'.
l_fieldcat-reptext_ddic = text-115.
when 'VERLD'.
l_fieldcat-outputlen = '20'.
l_fieldcat-seltext_m = text-116.
l_fieldcat-seltext_l = text-116.
l_fieldcat-col_pos = '7'.
l_fieldcat-just = 'C'.
l_fieldcat-reptext_ddic = text-116.
when 'HERKL'.
l_fieldcat-seltext_m = text-117.
l_fieldcat-seltext_l = text-117.
l_fieldcat-outputlen = '30'.
l_fieldcat-col_pos = '8'.
l_fieldcat-just = 'C'.
l_fieldcat-reptext_ddic = text-117.
when others.
l_fieldcat-no_out = 'X'.
endcase.
modify i_fieldcat from l_fieldcat.
endloop.
Call Function 'REUSE_ALV_LIST_DISPLAY' for dispaly of data in ALV.
call function 'REUSE_ALV_LIST_DISPLAY'
EXPORTING
i_callback_program = 'ZVRA0001FTB13'
it_fieldcat = i_fieldcat
it_events = xevents
i_save = 'A'
is_layout = t_layout
i_default = 'X'
is_variant = variante
i_bypassing_buffer = 'X'
i_buffer_active = ' '
TABLES
t_outtab = t_outsum
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.
MAHEEDHAR-START.
*"-- if detail summary checkbox is selected
elseIF R_MSSNG = 'X'.
PERFORM PREPARE_HEADER.
call function 'REUSE_ALV_FIELDCATALOG_MERGE'
exporting
i_program_name = 'ZVRA0001FTB13'
i_internal_tabname = 'I_OUTPUT'
i_inclname = 'ZVRA0001FTB13'
I_STRUCTURE_NAME =
I_CLIENT_NEVER_DISPLAY = 'X'
I_INCLNAME =
i_bypassing_buffer = 'X'
i_buffer_active = ' '
changing
ct_fieldcat = i_fieldcat
exceptions
inconsistent_interface = 1
program_error = 2
hi,
*& Report ZALV_FIELD_GRID1
REPORT ZALV_FIELD_GRID1
NO STANDARD PAGE HEADING.
TABLES MARA.
type-pools :slis.
TYPES : BEGIN OF TMARA ,
MATNR LIKE MARA-MATNR,
MEINS LIKE MARA-MEINS,
ERSDA LIKE MARA-ERSDA,
color(4) type c,
SEL type c,
LIGHT TYPE C,
END OF TMARA.
TYPES: BEGIN OF TMAKT,
MATNR LIKE MAKT-MATNR,
MAKTX LIKE MAKT-MAKTX,
MAKTG LIKE MAKT-MAKTG,
SEL TYPE C,
COLOR(4),
END OF TMAKT.
DATA: ITAB TYPE TMARA OCCURS 0 WITH HEADER LINE,
ITAB1 TYPE TMAKT OCCURS 0 WITH HEADER LINE,
wa_fieldcat type slis_fieldcat_alv,
fieldcat type slis_fieldcat_alv occurs 0,
i_layout type slis_layout_alv,
WA_LISTHEADER TYPE SLIS_LISTHEADER ,
i_LISTHEADER TYPE SLIS_LISTHEADER OCCURS 0,
V_EVENTS TYPE SLIS_T_EVENT ,
WA_EVENT TYPE SLIS_ALV_EVENT,
I_TITLE_MARA TYPE LVC_TITLE VALUE 'FIRST LIST DISPLAYED',
I_TITLE_MAKT TYPE LVC_TITLE VALUE 'SECONDRY LIST DISPLAYED',
SORT TYPE slis_t_sortinfo_alv WITH HEADER LINE,
PRINT_CONT type slis_print_alv.
SELECTION SCREE
selection-screen begin of block screen1 with frame title TEXT-001.
SELECTION-SCREEN SKIP.
SELECTION-SCREEN COMMENT /32(35) COMM1.
SELECTION-SCREEN ULINE /27(35).
SELECTION-SCREEN SKIP.
SELECT-OPTIONS MATNR FOR MARA-MATNR.
SELECTION-SCREEN SKIP.
SELECTION-SCREEN ULINE.
SELECTION-SCREEN COMMENT /30(50) COMM2.
SELECTION-SCREEN ULINE /27(40).
SELECTION-SCREEN SKIP.
SELECT-OPTIONS ERSDA FOR MARA-ERSDA.
SELECTION-SCREEN SKIP.
selection-screen end of block screen1.
INITIALIZATION
INITIALIZATION.
MATNR-low = '23'.
MATNR-high = '1000'.
MATNR-option = 'BT'.
MATNR-sign = 'I'.
APPEND MATNR.
ERSDA-low = '20030124'.
ERSDA-high = '20050302' .
APPEND ERSDA.
PERFORM FILLFIELD.
PERFORM FILLLAYOUT.
PERFORM build_print_params.
PERFORM FILL_SORT.
PERFORM EVENT_CALL.
PERFORM POPULATE_EVENT.
SELECTION-SCREEN OUTPUT
AT SELECTION-SCREEN OUTPUT.
comm1 ='SELECT MATERIAL NUMBER RANGE'.
comm2 ='SELECT MATERIAL CREATION DATE'.
START-OF-SELECTION
START-OF-SELECTION.
PERFORM READDATA.
PERFORM POPDATA.
*& Form READDATA
text
FORM READDATA .
CALL FUNCTION 'CONVERSION_EXIT_ALPHA_INPUT'
EXPORTING
INPUT = MATNR-LOW
IMPORTING
OUTPUT = MATNR-LOW.
CALL FUNCTION 'CONVERSION_EXIT_ALPHA_INPUT'
EXPORTING
INPUT = MATNR-HIGH
IMPORTING
OUTPUT = MATNR-HIGH.
SELECT MATNR
ERSDA
MEINS
FROM MARA
INTO CORRESPONDING FIELDS OF
TABLE ITAB
WHERE MATNR IN MATNR AND ERSDA IN ERSDA.
LOOP AT ITAB.
data id_color type i VALUE 1.
data id_colors(2) type c.
IF ITAB-MATNR < '000000000000000100'.
ITAB-LIGHT = '1'.
ELSEIF ITAB-MATNR < '000000000000000150' AND ITAB-MATNR >
'000000000000000100' .
ITAB-LIGHT = '2'.
ELSE.
ITAB-LIGHT = '3'.
ENDIF.
id_color = id_color + 1.
if id_color > 7.
id_color = 1.
endif.
id_colors = id_color.
concatenate 'C' id_colors '10' into itab-color.
modify itab.
CLEAR ITAB.
endloop.
ENDFORM. " READDATA
Form FILLFIELD
FORM FILLFIELD .
WA_FIELDCAT-FIELDNAME = 'MATNR'.
WA_FIELDCAT-KEY = 'X'.
WA_FIELDCAT-COL_POS = '1'.
WA_FIELDCAT-outputlen = 20.
WA_FIELDCAT-HOTSPOT = 'X'.
wa_fieldcat-seltext_m = 'MATERIAL NUMBER'.
*WA_FIELDCAT-EMPHASIZE = 'C210'.
APPEND WA_FIELDCAT TO FIELDCAT.
clear wa_fieldcat.
WA_FIELDCAT-FIELDNAME = 'MEINS'.
WA_FIELDCAT-COL_POS = '2'.
*WA_FIELDCAT-EMPHASIZE = 'C510'.
WA_FIELDCAT-outputlen = 10.
wa_fieldcat-seltext_m = 'UNIT'.
APPEND WA_FIELDCAT TO FIELDCAT.
clear wa_fieldcat.
WA_FIELDCAT-FIELDNAME = 'ERSDA'.
WA_FIELDCAT-COL_POS = '3'.
WA_FIELDCAT-outputlen = 15.
*WA_FIELDCAT-EDIT_MASK = 'DD.MM.YYYY'.
*WA_FIELDCAT-EMPHASIZE = 'C710'.
wa_fieldcat-seltext_m = 'CREAT DATE'.
APPEND WA_FIELDCAT TO FIELDCAT.
clear wa_fieldcat.
ENDFORM. "FILLFIELD
Setup print parameters
form build_print_params.
PRINT_CONT-reserve_lines = '3'. "Lines reserved for footer
PRINT_CONT-no_coverpage = 'X'.
endform. " BUILD_PRINT_PARAMS
Form POPDATA
FORM POPDATA .
CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
EXPORTING
I_INTERFACE_CHECK = ' '
I_BYPASSING_BUFFER = ' '
I_BUFFER_ACTIVE = ' '
I_CALLBACK_PROGRAM = sy-repid
I_CALLBACK_PF_STATUS_SET = ' '
I_CALLBACK_USER_COMMAND = 'USER-COMMAND'
I_CALLBACK_TOP_OF_PAGE = 'TOPPAGE'
I_CALLBACK_HTML_TOP_OF_PAGE = ' '
I_CALLBACK_HTML_END_OF_LIST = ' '
I_STRUCTURE_NAME =
I_BACKGROUND_ID = ' '
I_GRID_TITLE = I_TITLE_MARA
I_GRID_SETTINGS =
IS_LAYOUT = I_LAYOUT
IT_FIELDCAT = fieldcat
IT_EXCLUDING =
IT_SPECIAL_GROUPS =
IT_SORT = SORT[]
IT_FILTER =
IS_SEL_HIDE =
I_DEFAULT = 'X'
I_SAVE = ' '
IS_VARIANT =
IT_EVENTS = V_EVENTS
IT_EVENT_EXIT =
IS_PRINT = PRINT_CONT
TABLES
T_OUTTAB = ITAB
EXCEPTIONS
PROGRAM_ERROR = 1
OTHERS = 2
ENDFORM. " POPDATA
Form TOPPAGE
FORM TOPPAGE.
REFRESH I_LISTHEADER.
DATA: ld_lines type i,
ld_linesc(10) type c,
I_DATE(10) TYPE C,
I_INFO LIKE WA_LISTHEADER-INFO.
WA_LISTHEADER-TYP = 'H'.
WA_LISTHEADER-INFO = 'MATERIAL DETAIL'.
APPEND WA_LISTHEADER TO I_LISTHEADER.
CLEAR WA_LISTHEADER.
WA_LISTHEADER-TYP = 'S'.
WA_LISTHEADER-KEY = 'DATE :'.
CONCATENATE SY-DATUM+6(2) '.'
SY-DATUM+4(2) '.'
SY-DATUM(4) INTO I_DATE.
WA_LISTHEADER-INFO = I_datE.
APPEND WA_LISTHEADER TO I_LISTHEADER.
CLEAR WA_LISTHEADER.
describe table ITAB lines ld_lines.
ld_linesc = ld_lines.
concatenate 'TOTAL NUMBER OF RECORD SELECTED: ' ld_linesc
into I_INFO separated by space.
WA_LISTHEADER-TYP = 'A'.
WA_LISTHEADER-INFO = I_INFO.
append WA_LISTHEADER to I_LISTHEADER.
clear: WA_LISTHEADER , I_INFO.
CALL FUNCTION 'REUSE_ALV_COMMENTARY_WRITE'
EXPORTING
IT_LIST_COMMENTARY = I_LISTHEADER
I_LOGO = 'ENJOYSAP_LOGO'.
ENDFORM. "TOPPAGE
Form FILLLAYOUT
FORM FILLLAYOUT .
i_layout-zebra = 'X'.
i_layout-info_fieldname = 'COLOR'.
i_layout-box_fieldname = 'SEL'.
I_LAYOUT-lights_fieldname = 'LIGHT'.
I_LAYOUT-EDIT ='X'.
I_LAYOUT-colwidth_optimize = 'X'.
I_LAYOUT-window_titlebar = 'EXAMPLE FOR ALV GRID'.
I_LAYOUT-no_totalline = 'X'.
ENDFORM. "FILLLAYOUT
Form FILL_SORT
FORM FILL_SORT .
SORT-DOWN = 'X'.
SORT-SPOS = 1.
SORT-FIELDNAME = 'MATNR'.
SORT-tabname = 'MARA'.
APPEND SORT.
ENDFORM. " FILL_SORT
Form EVENT_CALL
FORM EVENT_CALL .
DATA: I_EVENT LIKE V_EVENTS.
CALL FUNCTION 'REUSE_ALV_EVENTS_GET'
EXPORTING
I_LIST_TYPE = 0
IMPORTING
ET_EVENTS = V_EVENTS.
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. " EVENT_CALL
Form POPULATE_EVENT
FORM POPULATE_EVENT .
READ TABLE V_EVENTS INTO WA_EVENT WITH KEY NAME = 'USER_COMMAND'.
IF SY-SUBRC EQ 0.
WA_EVENT-FORM = 'USER_COMMAND'.
MODIFY V_EVENTS FROM WA_EVENT TRANSPORTING FORM WHERE NAME =
WA_EVENT-NAME.
READ TABLE V_EVENTS WITH KEY NAME = SLIS_EV_END_OF_PAGE
INTO WA_EVENT.
IF SY-SUBRC = 0.
move 'END_OF_PAGE' to WA_EVENT-FORM.
MODIFY V_EVENTS FROM WA_EVENT TRANSPORTING FORM WHERE NAME =
WA_EVENT-NAME.
endif.
ENDIF.
ENDFORM. "POPULATE_EVENT
FORM END_OF_PAGE.
write: sy-uline(50).
skip.
write:/40 'Page:', sy-pagno .
ENDFORM.
*& Form USER_COMMAND
FORM USER_COMMAND USING R_UCOMM LIKE SY-UCOMM
RS_SELFIELD TYPE SLIS_SELFIELD.
CASE R_UCOMM.
WHEN '&IC1'.
CASE RS_SELFIELD-FIELDNAME.
when 'MATNR'.
read table itab with key matnr = RS_SELFIELD-VALUE.
if sy-subrc = 0.
PERFORM DATA_RETRIEVAL_MAKT USING RS_SELFIELD-VALUE.
PERFORM BUILD_FIELDCATLOG_MAKT.
PERFORM FILLLAYOUT_MAKT.
PERFORM DISPLAY_ALV_MAKT.
CLEAR RS_SELFIELD.
ENDIF.
ENDCASE.
ENDCASE.
ENDFORM. "user_command
Form DATA_RETRIEVAL_MAKT
FORM DATA_RETRIEVAL_MAKT USING TMATNR .
SELECT MATNR
MAKTX
MAKTG
UP TO 100 ROWS
FROM MAKT
INTO TABLE ITAB1
WHERE SPRAS = 'EN' AND MATNR = TMATNR.
LOOP AT ITAB1.
data id_color type i VALUE 1.
data id_colors(2) type c.
id_color = id_color + 1.
if id_color > 7.
id_color = 1.
endif.
id_colors = id_color.
concatenate 'C' id_colors '10' into itab1-color.
modify itab1.
CLEAR ITAB1.
ENDLOOP.
ENDFORM. "DATA_RETRIEVAL_MAKT
Form FILLLAYOUT_MAKT
FORM FILLLAYOUT_MAKT .
CLEAR I_LAYOUT.
i_layout-zebra = 'X'.
i_layout-info_fieldname = 'COLOR'.
i_layout-box_fieldname = 'SEL'.
I_LAYOUT-EDIT ='X'.
I_LAYOUT-colwidth_optimize = 'X'.
I_LAYOUT-window_titlebar = 'EXAMPLE FOR ALV GRID'.
ENDFORM. " LAYOUT_MAKT
Form BUILD_FIELDCATLOG_MAKT
FORM BUILD_FIELDCATLOG_MAKT .
REFRESH FIELDCAT.
WA_FIELDCAT-FIELDNAME = 'MATNR'.
WA_FIELDCAT-KEY = 'X'.
WA_FIELDCAT-COL_POS = '1'.
*WA_FIELDCAT-EDIT_MASK = 'DD.MM.YYYY'.
WA_FIELDCAT-EMPHASIZE = 'C510'.
wa_fieldcat-seltext_m = 'MATERIAL NUMBER'.
APPEND WA_FIELDCAT TO FIELDCAT.
clear wa_fieldcat.
WA_FIELDCAT-FIELDNAME = 'MAKTX'.
WA_FIELDCAT-COL_POS = '2'.
WA_FIELDCAT-EMPHASIZE = 'C710'.
wa_fieldcat-seltext_m = 'MATERIAL DESCRIPTION'.
APPEND WA_FIELDCAT TO FIELDCAT.
clear wa_fieldcat.
WA_FIELDCAT-FIELDNAME = 'MAKTG'.
WA_FIELDCAT-COL_POS = '3'.
WA_FIELDCAT-EMPHASIZE = 'C210'.
wa_fieldcat-seltext_m = 'MATERIAL DESCRIPTION'.
APPEND WA_FIELDCAT TO FIELDCAT.
clear wa_fieldcat.
ENDFORM. " BUILD_FIELDCATLOG_MAKT
Form DISPLAY_ALV_MAKT
FORM TOP-OF-PAGE.
REFRESH I_LISTHEADER.
DATA: ld_lines type i,
ld_linesc(10) type c,
I_DATE(10) TYPE C,
I_INFO LIKE WA_LISTHEADER-INFO.
WA_LISTHEADER-TYP = 'H'.
WA_LISTHEADER-INFO = 'MATERIAL DESCRIPTION FOR SELECTED NUMBER'.
APPEND WA_LISTHEADER TO I_LISTHEADER.
CLEAR WA_LISTHEADER.
WA_LISTHEADER-TYP = 'S'.
WA_LISTHEADER-KEY = 'DATE :'.
CONCATENATE SY-DATUM+6(2) '.'
SY-DATUM+4(2) '.'
SY-DATUM(4) INTO I_DATE.
WA_LISTHEADER-INFO = I_datE.
APPEND WA_LISTHEADER TO I_LISTHEADER.
CLEAR WA_LISTHEADER.
describe table ITAB1 lines ld_lines.
ld_linesc = ld_lines.
concatenate 'TOTAL NUMBER OF RECORD SELECTED: ' ld_linesc
into I_INFO separated by space.
WA_LISTHEADER-TYP = 'A'.
WA_LISTHEADER-INFO = I_INFO.
append WA_LISTHEADER to I_LISTHEADER.
clear: WA_LISTHEADER , I_INFO.
CALL FUNCTION 'REUSE_ALV_COMMENTARY_WRITE'
EXPORTING
IT_LIST_COMMENTARY = I_LISTHEADER
I_LOGO = 'ENJOYSAP_LOGO'.
I_END_OF_LIST_GRID =
I_ALV_FORM =
ENDFORM. "TOP-OF-PAGE
*& Form DISPLAY_ALV_MAKT
text
FORM DISPLAY_ALV_MAKT .
CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
EXPORTING
I_CALLBACK_PROGRAM = SY-REPID
I_CALLBACK_TOP_OF_PAGE = 'TOP-OF-PAGE'
I_GRID_TITLE = I_TITLE_MAKT
IS_LAYOUT = I_LAYOUT
IT_FIELDCAT = fieldcat
TABLES
T_OUTTAB = ITAB1
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. " DISPLAY_ALV_MAKT
Regards
Ashok kumar -
Hide delete option is not working in ALV List Display- urgent
Hi All,
In my program i am displaying the output by using alv list display. after displaying the data i am displaying my own pf status here. in this i have few pushbuttons like
selest all, deselect all, hide . first two options are working fine. when i click hide button selected records are going to be hide.but this is not happening in my program. any body cam send me the code plz.
i am sending my code below. if possible please modify and resend the code asap.
my code:
type-pools : slis.
tables : zuser_secobjects.
data : t_header1 like zuser_secobjects.
data : begin of it_secobjects occurs 0.
include structure t_header1.
*data : box,
input(1) type c,
data : checkbox type c,
flag type c,
end of it_secobjects.
data : wa_ita like line of it_secobjects.
*data : it_secobjects like zuser_secobjects occurs 0 with header line.
data : i_field type slis_t_fieldcat_alv with header line.
data : w_field like line of i_field.
data : i_sort type slis_t_sortinfo_alv.
data : w_sort like line of i_sort.
data : it_filt1 type slis_t_filter_alv with header line.
data:
i_tabname type tabname,
i_repid like sy-repid,
is_lout type slis_layout_alv.
data : it_filt type slis_t_filter_alv with header line,
it_evts type slis_t_event with header line.
DATA : is_vari type disvariant.
constants : c_default_vari value 'X',
c_save_vari value 'U',
c_checkfield type slis_fieldname value 'ACTION',
c_f2code type sy-ucomm value '&ETA'.
data : chk_box type slis_fieldname.
selection-screen: begin of block b1 with frame title text-t01.
parameters : p_appln type zuser_secobjects-appln.
parameters : p_user type usr02-bname, "zuser_secobjects-appln_user,
p_partnr type zuser_secobjects-appln_partner,
p_ptype type zuser_secobjects-partner_type default '02',
p_upostn type zuser_secobjects-user_position,
p_sdate like likp-erdat default sy-datum,
p_edate(10) default '12/31/9999',
p_revnum type zuser_secobjects-revnum,
p_cted type zuser_secobjects-created_by,
p_cdate type zuser_secobjects-creation_date,
p_ctime type zuser_secobjects-creation_time,
p_chnby type zuser_secobjects-changed_by,
p_cdate1 type zuser_secobjects-changed_date,
p_ctime1 type zuser_secobjects-changed_time.
selection-screen: end of block b1.
form user_command using p_ucomm like sy-ucomm
rs_selfield type slis_selfield.
*DATA : it_filt type slis_t_filter_alv with header line.
case p_ucomm.
when 'SELECT_ALL'. " SELALL is the FCODE of ur push button
loop at it_secobjects into wa_ita.
wa_ita-checkbox = 'X'.
modify it_secobjects from wa_ita.
endloop.
rs_selfield-refresh = 'X'. "<- ADD THIS
when 'DESLCT_ALL'.
loop at it_secobjects into wa_ita.
wa_ita-checkbox = ' '.
modify it_secobjects from wa_ita.
endloop.
rs_selfield-refresh = 'X'. "<- ADD THIS
is_lout-f2code = c_f2code.
is_lout-box_fieldname = c_checkfield.
is_lout-get_selinfos = 'X'.
is_lout-detail_popup = 'X'.
is_lout-detail_initial_lines = 'X'.
when 'HIDE_DEL'.
rs_selfield-exit = 'X'.
it_filt-fieldname = 'CHECKBOX'.
it_filt-tabname = '1'.
it_filt-valuf = 'X'.
it_filt-intlen = '1'.
it_filt-inttype = 'C'.
it_filt-datatype = 'CHAR'.
it_filt-valuf_int = 'X'.
it_filt-sign0 = 'E'.
it_filt-optio = 'EQ'.
if it_filt[] is initial.
append it_filt.
else.
modify it_filt index 1.
endif.
perform display using i_object.
PERForm ALV_LIST_DISPLAY.
WHEN 'SHOW_DEL'.
rs_selfield-exit = 'X'.
free it_filt.
PERForm ALV_LIST_DISPLAY.
when 'SAVE1'.
select * from zuser_secobjects where
appln = zuser_secobjects-appln
and appln_partner = zuser_secobjects-appln_partner
and partner_type = zuser_secobjects-partner_type
and start_date = zuser_secobjects-start_date
and end_date = zuser_secobjects-end_date.
endselect.
if sy-subrc eq 0.
message e000(ZV) with 'Duplicate Entry'.
endif.
endcase.
endform.
*& Form delete
form delete.
data : begin of is_secobjects occurs 0.
include structure zuser_secobjects.
data : checkbox type c.
data : end of is_secobjects.
is_secobjects-checkbox = 'X'.
modify is_secobjects
from it_secobjects
transporting checkbox
where checkbox = 'X'.
endform.
*& Form get_data
form get_data.
select * from zuser_secobjects
into table it_secobjects.
endform. " get_data
*& Form prepare_fieldcatalog
text
--> p1 text
<-- p2 text
form prepare_fieldcatalog.
clear: w_field,i_field.
refresh:i_field.
i_field-key = 'X'.
i_field-col_pos = 1.
i_field-ddictxt = 'S'.
i_field-seltext_s = '@11@'.
i_field-checkbox = 'X'.
i_field-input = 'X'.
i_field-fieldname = 'HEADER'.
i_field-outputlen = 0.
append i_field.
clear i_field.
w_field-fieldname = 'APPLN'.
w_field-tabname = 'IT_SECOBJECTS'.
w_field-seltext_l = text-m01.
w_field-outputlen = '10'.
w_field-col_pos = 1.
append w_field to i_field.
clear w_field.
w_field-fieldname = 'APPLN_USER'.
w_field-tabname = 'IT_SECOBJECTS'.
w_field-just = 'C'.
w_field-seltext_l = text-m02.
w_field-outputlen = '7'.
w_field-col_pos = 2.
append w_field to i_field.
clear w_field.
endform. " prepare_fieldcatalog
*& Form ALV_LIST_DISPLAY
text
--> p1 text
<-- p2 text
form alv_list_display.
i_repid = sy-repid.
is_lout-box_fieldname = 'CHECKBOX'.
it_filt-fieldname = 'CHECKBOX'.
call function 'REUSE_ALV_LIST_DISPLAY'
exporting
i_callback_program = i_repid
i_callback_pf_status_set = 'PF_STATUS_SET'
i_callback_user_command = 'USER_COMMAND'
is_layout = is_lout
it_fieldcat = i_field[]
it_filter = it_filt[]
it_events = it_evts[]
i_default = c_default_vari
i_save = c_save_vari
is_variant = is_vari
tables
t_outtab = it_secobjects.
endform. " ALV_LIST_DISPLAY
*& Form display
text
-->P_I_OBJECT text
form display using object.
case object.
ENDCASE.
endform. " display
thanks,
maheedhar.tHi,
What do you mean by Hiding the records.
Deleting completely from the screen.
You can just delete the records from the internal table and pass to field catalog before displaying again.
or serach in the slis structrue for hiding the contents of the output.
reward if useful
regards,
Anji -
How to edit particular field in alv list display-urgent
HI ALL,
my requirement is i am displaying output using alv list display. now my rewuirement :
i am displaying out in edit mode only. when user clicks one particular field
for example record is like
runrate a01 maheed -> if user clicks on a01 this field should be editable. i have a following code
w_field-edit = w_edit.
w_field-input = 'X'. -> using this code i can able to display entire colomn in edit mode. this not suits my requirement.anybody can send me the sample code please.
thanks,
maheedhar.tCan you please send me the sample code plz.
i am sending my code below.
type-pools : slis.
tables : zuser_secobjects.
data : t_header1 like zuser_secobjects.
data : begin of it_secobjects occurs 0.
include structure t_header1.
data : checkbox type c value 'X',
action type c,
end of it_secobjects.
data : begin of it_secobjects1 occurs 0.
include structure ZUSER_SECOBJECTS.
data : checkbox type c VALUE 'X',
end of it_secobjects1.
data : wa_ita like line of it_secobjects.
data : i_field type slis_t_fieldcat_alv with header line.
data : w_field like line of i_field.
data : i_sort type slis_t_sortinfo_alv.
data : w_sort like line of i_sort.
data : it_filt1 type slis_t_filter_alv with header line.
data:
i_tabname type tabname,
i_repid like sy-repid,
is_lout type slis_layout_alv.
data : it_filt type slis_t_filter_alv with header line,
it_evts type slis_t_event with header line.
DATA : is_vari type disvariant.
constants : c_default_vari value 'X',
c_save_vari value 'U',
c_checkfield type slis_fieldname value 'ACTION',
c_f2code type sy-ucomm value '&ETA'.
data : chk_box type slis_fieldname.
selection-screen: begin of block b1 with frame title text-t01.
parameters : p_appln type zuser_secobjects-appln.
parameters : p_user type usr02-bname, "zuser_secobjects-appln_user,
p_partnr type zuser_secobjects-appln_partner,
p_ptype type zuser_secobjects-partner_type default '02',
p_upostn type zuser_secobjects-user_position,
p_sdate like likp-erdat default sy-datum,
p_edate(10) default '12/31/9999',
p_revnum type zuser_secobjects-revnum,
p_cted type zuser_secobjects-created_by,
p_cdate type zuser_secobjects-creation_date,
p_ctime type zuser_secobjects-creation_time,
p_chnby type zuser_secobjects-changed_by,
p_cdate1 type zuser_secobjects-changed_date,
p_ctime1 type zuser_secobjects-changed_time.
selection-screen: end of block b1.
form user_command using p_ucomm like sy-ucomm
rs_selfield type slis_selfield.
case p_ucomm.
when 'SELECT_ALL'. " SELALL is the FCODE of ur push button
loop at it_secobjects into wa_ita.
wa_ita-checkbox = 'X'.
modify it_secobjects from wa_ita.
endloop.
rs_selfield-refresh = 'X'. "<- ADD THIS
when 'DESLCT_ALL'.
loop at it_secobjects into wa_ita.
wa_ita-checkbox = ' '.
modify it_secobjects from wa_ita.
endloop.
rs_selfield-refresh = 'X'. "<- ADD THIS
is_lout-f2code = c_f2code.
is_lout-box_fieldname = c_checkfield.
is_lout-get_selinfos = 'X'.
is_lout-detail_popup = 'X'.
is_lout-detail_initial_lines = 'X'.
maheed-start.
*when 'SAVE'.
*LOOP AT IT_SECOBJECTS WHERE CHECKBOX = 'X'.
MOVE-CORRESPONDING IT_SECOBJECTS TO IT_SECOBJECTS1.
APPEND IT_SECOBJECTS1.
CLEAR IT_SECOBJECTS1.
DELETE IT_SECOBJECTS.
*ENDLOOP.
*DELETE ZUSER_SECOBJECTS FROM TABLE IT_SECOBJECTS1.
WHEN 'DELETE'.
loop at it_SECOBJECTS where checkbox eq 'X'.
delete it_SECOBJECTS.
endloop.
*RS_SELFIELD-REFRESH = 'X'.
maheed-end.
maheed-start. apr 13
WHEN 'DELETE'.
loop at it_SECOBJECTS where checkbox eq 'X'.
MOVE-CORRESPONDING IT_SECOBJECTS TO IT_SECOBJECTS1.
APPEND IT_SECOBJECTS1.
delete it_SECOBJECTS.
endloop.
RS_SELFIELD-REFRESH = 'X'.
when 'SAVE'.
DELETE ZUSER_SECOBJECTS FROM TABLE IT_SECOBJECTS1.
commit work.
refresh :IT_SECOBJECTS1.
maheed-end. apr 13
*when 'SAVE'.
*LOOP AT IT_SECOBJECTS WHERE CHECKBOX = 'X'.
MOVE-CORRESPONDING IT_SECOBJECTS TO IT_SECOBJECTS1.
APPEND IT_SECOBJECTS1.
CLEAR IT_SECOBJECTS1.
DELETE IT_SECOBJECTS.
*ENDLOOP.
*DELETE ZUSER_SECOBJECTS FROM TABLE IT_SECOBJECTS1.
ENDCASE.
endform.
*& Form delete
form delete.
data : begin of is_secobjects occurs 0.
include structure zuser_secobjects.
data : checkbox type c.
data : end of is_secobjects.
is_secobjects-checkbox = 'X'.
modify is_secobjects
from it_secobjects
transporting checkbox
where checkbox = 'X'.
endform.
*& Form get_data
form get_data.
select * from zuser_secobjects
into table it_secobjects.
endform. " get_data
*& Form prepare_fieldcatalog
text
--> p1 text
<-- p2 text
form prepare_fieldcatalog." USING w_edit TYPE any.
data : w_edit type c.
clear w_edit.
clear: w_field,i_field.
refresh:i_field.
i_field-key = 'X'.
i_field-col_pos = 1.
i_field-ddictxt = 'S'.
i_field-seltext_s = '@11@'.
i_field-checkbox = 'X'.
i_field-input = 'X'.
i_field-fieldname = 'HEADER'.
i_field-outputlen = 0.
append i_field.
clear i_field.
w_field-fieldname = 'APPLN'.
w_field-tabname = 'IT_SECOBJECTS'.
w_field-seltext_l = text-m01.
w_field-outputlen = '10'.
w_field-EDIT = 'X'. "maheed
w_field-col_pos = 1.
append w_field to i_field.
clear w_field.
w_field-fieldname = 'APPLN_USER'.
w_field-tabname = 'IT_SECOBJECTS'.
w_field-just = 'C'.
w_field-seltext_l = text-m02.
w_field-outputlen = '7'.
w_field-col_pos = 2.
append w_field to i_field.
clear w_field.
w_field-fieldname = 'APPLN_PARTNER'.
w_field-tabname = 'IT_SECOBJECTS'.
w_field-just = 'C'.
w_field-seltext_l = text-m03.
w_field-edit = w_edit.
w_field-input = 'X'.
w_field-outputlen = '7'.
w_field-col_pos = 2.
append w_field to i_field.
clear w_field.
w_field-fieldname = 'INACTIVE'.
w_field-tabname = 'IT_SECOBJECTS'.
w_field-just = 'C'.
w_field-seltext_l = text-m02.
w_field-outputlen = '7'.
w_field-col_pos = 3.
append w_field to i_field.
clear w_field.
endform. " prepare_fieldcatalog
*& Form ALV_LIST_DISPLAY
text
--> p1 text
<-- p2 text
form alv_list_display.
DATA : LC_GLAY TYPE LVC_S_GLAY.
LC_GLAY-EDT_CLL_CB = 'X'.
i_repid = sy-repid.
is_lout-box_fieldname = 'CHECKBOX'.
it_filt-fieldname = 'ACTION'.
call function 'REUSE_ALV_LIST_DISPLAY'
exporting
i_callback_program = i_repid
i_callback_pf_status_set = 'PF_STATUS_SET'
i_callback_user_command = 'USER_COMMAND'
is_layout = is_lout
it_fieldcat = i_field[]
it_filter = it_filt[]
it_events = it_evts[]
i_default = c_default_vari
i_save = c_save_vari
is_variant = is_vari
tables
t_outtab = it_secobjects.
endform. " ALV_LIST_DISPLAY
*& Form display
text
-->P_I_OBJECT text
form display using object.
case object.
ENDCASE.
endform. " display
thanks,
maheedhar.t -
Cost Center Display - Urgent Please
While data entry, a particular expense range GL Account (Non Recovered VAT) is not displaying the Cost Center field. I have checked the Field Status Group of this particular GL wherein Cost Center is field is optional and not suppressed. Even the posting keys settings are perfect. On the other hand, another expense Account (Vehicle Maintenance A/c) has the similar Field Status Group and for this account the entry screen displays the Cost Center field rightly.
Please let me know where else can the input screen for a given GL Account is impacted, apart from Field Status Grp, Posting Key and Account Group.
This is a Production issue and requires immediate attention and help.
Thank you
Ravi
Mobile 9849393564> Hi,
>
> If you are pasing transaction through FI, then
> compare field status group of GL acount and posting
> key field status group .
>
> Cheers
> PK
Hi PK
In both the FSGs cost center is optional and not suppressed -
Need help with page display URGENTLY!!!
Hey,
I'm trying to start up my new iPod nano. I've got the songs for it, but the page won't display all the way. Where it says the licence of agreement it won't show the o.k. button and before that it doesn't say the register button either. It doesn't do this on my internet. Or on anything else. So now I can't put anything on my iPod because I can't get it started up.
Please help! I really need to put some songs on my new iPod!!!!
Please and thank you.
xKeegaNxTry increasing the resolution of your computer's screen (right-click on the desktop -> Properties - Settings; you want 1024x768 or higher) and perhaps then you'll be able to see all the buttons and controls in iTunes.
Maybe you are looking for
-
I haven't been able to use the camera using mozGetUserMedia in two differents brands of windows tablets. I'm getting HARDWARE_UNAVAILABLE, What Can I do to solve this issue? I really need this to work
-
XML files and assemblies in bin directory
In VS 2010 the bin directory was very simple and straight forward. Now in VS 2012 Web apps the bin directory is filled with a bunch of System and Microsoft assemblies a bunch of folders named with the two letter country code use in URLs and a bunch
-
Can't open attachment on calendar...sort of
Mountain Lion and iCloud sure are weird! I just created an event in Calendar on my Mac. I attached a pdf to the event. Click on it and the attachment opens--very nice. Now I look at the event on my iPhone. I click on the attachment and I'm told I can
-
First Photo Transfer From iPad to PC a FAIL
WOW... What a FAIL. I just moved for the first time to my new iPad 48 .jpg pictures from my camera memory chip. That went fine. Next I hooked up the transfer cable to the PC (Windows 7, 64-bit) and transferred the 48 pictures from the iPad to My
-
Final Fantasy XIII-2 Crystal Edition
Does anyone know if Final Fantasy XIII-2 Crystal Edition will arrive to US (Best buy)? I wish to buy the Crystal Edition rather than the Collectors edition. Solved! Go to Solution.