F4 for a field
hi everybody,
I have 2 fields on the screen
X1 and X2.
and i have an internal table with 4 fields (itab).
my problem is i want the whole internal table when i press F4 on filed X1
and if i select a record from F4, field X1 must be populated with (itab-field1)
and field X2 also should be populated with a value from the internal table(itab-field2)
Please help me out.
please tell me what to write in PBO and what in PAI
hi,
here is some info...........
If you created a search help in the DDIC...Then check the check box EXPORt parameter for one of the fields
If you used the function module Make sure you pass the correct values..Also the field name in CAPITAL letters..
Check this code..
TABLES: T005T.
DATA: BEGIN OF t_t005 OCCURS 0,
land1 TYPE t005-land1,
END OF t_t005.
SELECTION-SCREEN BEGIN OF LINE.
SELECTION-SCREEN COMMENT 1(6) v_text FOR FIELD P_LAND1.
PARAMETERS: p_land1 TYPE t005-land1.
SELECTION-SCREEN COMMENT 13(35) v_text1.
SELECTION-SCREEN END OF LINE.
INITIALIZATION.
v_text = 'Country'.
v_text1 = ' '.
AT SELECTION-SCREEN ON VALUE-REQUEST FOR p_land1.
REFRESH: t_t005.
SELECT land1
INTO TABLE t_t005
FROM t005.
CALL FUNCTION 'F4IF_INT_TABLE_VALUE_REQUEST'
EXPORTING
DDIC_STRUCTURE = 'T005'
PVALKEY = ' '
retfield = 'LAND1'
dynpprog = sy-repid
DYNPNR = sy-dynnr
dynprofield = 'P_LAND1'
callback_program = sy-repid
value_org = 'S'
TABLES
value_tab = t_t005
EXCEPTIONS
parameter_error = 1
no_values_found = 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.
other way would be..............
SELECT-OPTIONS: selcrit for <data>.
Now use
AT SELECTION-SCREEN ON VALUE-REQUEST FOR selcrit-LOW.
*Using the FM F4IF_INT_TABLE_VALUE_REQUEST to show the F4
AT SELECTION-SCREEN ON VALUE-REQUEST FOR selcrit-HIGH.*Using the FM F4IF_INT_TABLE_VALUE_REQUEST to show the F4
Similar Messages
-
Check for required fields before locking subforms and submitting
Hello,
I have a 5-page form with many questions, to be completed by the original requestor and multiple approvers. What I'm trying to do is have the original requestor's Submit button on p. 3 lock the input on the first three pages, but first check if all those fields have some content. I currently have all the fields on pp. 1-3 set to "Required" in the object properties, but my script still locks them when there's is one empty one. Here's what I have:
//Lock portions of form
Page1.access = "readOnly"
Page2.access = "readOnly"
Page3.access = "readOnly"
//Save document, allow user to change name
app.execMenuItem("SaveAs");
//Submit via e-mail
Submit_REAL.event__click.submit.target = "mailto:[email protected]" +
"?subject=Subject text" +
"&body=Message";
Submit_REAL.execEvent("click");
The automatic check for required fields happens after the pages get locked. I would like the check to stop the process before it locks the pages. Is there any way to check all at once that all "Required" fields on those pages have some content before allowing the script to proceed? I know how to script it to manually check the 50 or so questions on those pages, but I would like to avoid that. Thanks for any help.There are a few problems that I can see from the start. First, your code is going to pick up EVERY node that exists on these pages. Some of those nodes will not have a rawValue, and some will not have an actual name. As an example, you can take your code and create a text field to dump all of the names of the nodes that you get when you pull in all of the nodes this way. Here's an example:
The result:
Now, the question is, do you have a consistent naming convention for your fields that might be empty? That could be text fields, radio button lists, etc. For instance, I always prefix the names of objects in order to more easily keep track of what they are in scripts. Since I'm doing that, I can check the name of the field for tf, nf, rbl, cb, or whatever I have included to make sure that I'm checking an actual field before I check for things like rawValue.
var nodeName = oNodes.item(nNodeCount).name;
if (nodeName.indexOf("tf")>-1 || nodeName.indexOf("rbl") > -1 || /*check other field types*/) {
//insert your code to check for empty answers here
As for your line 7 issue. The syntax problem is that you've put extra parentheses in your if statement. Take out the parentheses that are just before and after the or "||".
*This is my fourth attempt to reply. Something was going on with Adobe/Jive earlier, I suppose. -
Data not loading for new Fields InfoObjects from DSO to InfoCube
Hi Gurus -
I have a DataSource that is providing data to existing DSO then to Infocube. My client asked me to added couple fields to DataSource and get the data to DSO and then DSO to InfoCube.
Here is the Old scenarion: DataSource -> DSO -> InfoCube.
Here is the New Scenation:
DataSource ( Added new fields) -> DSO (added new InfoObjects for Corresponding DataSource FIelds) -> InfoCube( Added new InfoObjects to mapped from DSO)
I added the new fields to DataSource, added the corresponding InfoObjects to DSO and InfoCube.
I successfully loaded data from DataSource to DSO. Data is populating for the new Fields/InfoObjects in DSO.
But when I load data from DSO to InfoCube, I don't see any data for New Fields InfoObjects in the InfoCube.
Data from DSO to InfoCube is loading fine for the Old InfoObjects Fields but not for the New InfoObjects I added in InfoCube.
-SonaliHi,
Why dont u debug the load through DTP debugging and check what happens to the source field and target field once it passes through the transformation. You can easily trace back where the fields are becoming blank.
The loads which you have mentioned earlier did it have values in Added Records/Transferred Records column for the cube.
Regards,
Mani -
Set maximum size in Text Form Field Options for a field in bi publisher RTF
Hi All,
How to set maximum size in Text Form Field Options for a field in bi publisher RTF.
I have a RTF whch is having a field in that i need to add some validation condition but after adding certain condition in Add help text tab ,it is not accepting after certain length, how i can increase the length to unlimited,please help me on this
ThnaksForm fields have some restrictions if your are using version lower than 11g.
They can accommodate only 393 chars. You can add the text in both status bar and help key, which can in total consume 393 chars.
If your code logic is more than that, it can be split into multiple form fields as Avinash suggested or you can use sub template logic and handle coding over there. Again in sub template code can be within/outside form fields.
So there is no option for user to increase the size of form field. -
How to get the values in the dropdown listbox for screen field
hi friends !
I have selected dropdown listbox for a field in the screeen. Now, how to pass the possible values into the list. Please give the kind help.
Regards,
-Prasad.Hi Prasad,
As Raja had mentioned, this topic has been discussed many times in this forum in the past. Please make sure that you first search the forum for related topics before you post new ones. that would avoid a lot of redundancy. Anyays, here are some of the topics you can refer to:
Drop down list
DROP DOWN BOX
http://help.sap.com/saphelp_46c/helpdata/en/9f/dbabe435c111d1829f0000e829fbfe/content.htm
Regards,
Anand Mandalika.
P.S: Please don't forget to reward points and close the thread once your problem is resolved. -
Define read-only authorization for specific field(s) on a form for 11.5.9
Dear all,
Can you pls let me know how is it possible to define read-only authorization access for specific field(s) per responsibility / user on a form in 11.5.9?
For example I want to protect the item master file by assigning for example to users with responsibility buyer authorization to modify the buyer information but to have read-only only authorization on other sensitive fields such as make/buy flag, expense accounts, etc
Through UI Modeller I have only managed to make specific fields on specific forms invisible, or whole tabs invisible, to specific responsibilities but this does not cover my needs as I want them to be able to view the data of the fields but to not be able to update themArun,
Almost but not quite.. The example you've given has the person VO at the top level which includes all the id's (City, State etc). My use case is slightly different.
query 1
select org_id, OrgName from x;
query 2
select emp_id, emp_name from y where org_id = x.org_id
query 3
multi-table join (approx 9 tables) to retrieve depts associated to employee
where org_id = x.org_id
and emp_id = y.emp_id
Rather than using LOV's would it be better to create VO's and pass in the bind parameters at run time? -
Setting currency and measurement unit for a field in an ALV report
Plz give sample code to set currency and measurement unit for a field in an ALV report
dear friend
i am seanding you
the display form
if you need select form
and process form also pls keep in touch.
if help full rewards are expecting.
yours
vivek
FORM build_field_catalog .
DATA: w_dthigh(10).
CLEAR fcat.
fcat-fieldname = 'VBELN'.
fcat-outputlen = 10.
fcat-seltext_s = 'COMMERCIAL INVOICE'.
fcat-seltext_m = 'Commercial Invoice'.
fcat-seltext_l = 'COMMERCIAL INVOICE'.
fcat-ddictxt = 'M'.
fcat-inttype = 'C'.
fcat-datatype = 'CHAR'.
fcat-key = 'X'.
fcat-hotspot = 'X'.
APPEND fcat.
CLEAR fcat.
fcat-fieldname = 'EXNUM'.
fcat-outputlen = 10.
fcat-seltext_s = 'EXCISE INVOICE'.
fcat-seltext_m = 'Excise Invoice'.
fcat-seltext_l = 'EXCISE INVOICE'.
fcat-ddictxt = 'M'.
fcat-inttype = 'C'.
fcat-datatype = 'CHAR'.
fcat-hotspot = 'X'.
APPEND fcat.
CLEAR fcat.
fcat-fieldname = 'EXDAT'.
fcat-outputlen = 10.
fcat-seltext_s = 'EXCISE DATE'.
fcat-seltext_m = 'Excise Date'.
fcat-seltext_l = 'EXCISE DATE'.
fcat-ddictxt = 'M'.
fcat-inttype = 'D'.
fcat-datatype = 'DATS'.
APPEND fcat.
CLEAR fcat.
fcat-fieldname = 'NAME1'.
fcat-outputlen = 30.
fcat-seltext_s = 'CUSTOMER'.
fcat-seltext_m = 'Customer'.
fcat-seltext_l = 'CUSTOMER'.
fcat-ddictxt = 'M'.
fcat-inttype = 'C'.
fcat-datatype = 'CHAR'.
fcat-lowercase = 'X'.
APPEND fcat.
CLEAR fcat.
fcat-fieldname = 'ZZPD'.
fcat-outputlen = 15.
fcat-seltext_s = 'COUNTRY'.
fcat-seltext_m = 'COUNTRY'.
fcat-seltext_l = 'COUNTRY'.
fcat-ddictxt = 'M'.
fcat-inttype = 'C'.
fcat-datatype = 'CHAR'.
fcat-lowercase = 'X'.
APPEND fcat.
CLEAR fcat.
fcat-fieldname = 'WERKS'.
fcat-outputlen = 4.
fcat-seltext_s = 'PLANT'.
fcat-seltext_m = 'Plant'.
fcat-seltext_l = 'PLANT'.
fcat-ddictxt = 'M'.
fcat-inttype = 'C'.
fcat-datatype = 'CHAR'.
fcat-key = 'X'.
APPEND fcat.
CLEAR fcat.
fcat-fieldname = 'ARKTX'.
fcat-outputlen = 40.
fcat-seltext_s = 'MATERIAL DESCRIPTION'.
fcat-seltext_m = 'Material Description'.
fcat-seltext_l = 'MATERIAL DESCRIPTION'.
fcat-ddictxt = 'M'.
fcat-inttype = 'C'.
fcat-datatype = 'CHAR'.
fcat-lowercase = 'X'.
APPEND fcat.
CLEAR fcat.
fcat-fieldname = 'FKART'.
fcat-outputlen = 4.
fcat-seltext_s = 'Billing type'.
fcat-seltext_m = 'Billing type'.
fcat-seltext_l = 'Billing type'.
fcat-ddictxt = 'M'.
fcat-inttype = 'C'.
fcat-datatype = 'CHAR'.
fcat-key = 'X'.
APPEND fcat.
CLEAR fcat.
fcat-fieldname = 'INCO1'.
fcat-outputlen = 5.
fcat-seltext_s = 'INCO TERMS'.
fcat-seltext_m = 'INCO TERMS'.
fcat-seltext_l = 'INCO TERMS'.
fcat-ddictxt = 'M'.
fcat-inttype = 'C'.
fcat-datatype = 'CHAR'.
APPEND fcat.
CLEAR fcat.
fcat-fieldname = 'INCO2'.
fcat-outputlen = 10.
fcat-seltext_s = 'INCO TERMS DES'.
fcat-seltext_m = 'INCO TERMS DES'.
fcat-seltext_l = 'INCO TERMS DES'.
fcat-ddictxt = 'M'.
fcat-inttype = 'C'.
fcat-datatype = 'CHAR'.
APPEND fcat.
CLEAR fcat.
fcat-fieldname = 'FKIMG'.
fcat-outputlen = 14.
fcat-seltext_s = 'QUANTITY'.
fcat-seltext_m = 'Quantity'.
fcat-seltext_l = 'QUANTITY'.
fcat-ddictxt = 'M'.
fcat-inttype = 'P'.
fcat-datatype = 'QUAN'.
APPEND fcat.
CLEAR fcat.
fcat-fieldname = 'FKLMG'.
fcat-outputlen = 10.
fcat-seltext_s = 'QUANTITY'.
fcat-seltext_m = 'QUANTITY'.
fcat-seltext_l = 'QUANTITY'.
fcat-ddictxt = 'M'.
fcat-inttype = 'P'.
fcat-datatype = 'QUAN'.
APPEND fcat.
CLEAR fcat.
fcat-fieldname = 'MEINS'.
fcat-outputlen = 5.
fcat-seltext_s = 'UNIT'.
fcat-seltext_m = 'UNIT'.
fcat-seltext_l = 'UNIT'.
fcat-ddictxt = 'M'.
fcat-inttype = 'C'.
fcat-datatype = 'CHAR'.
APPEND fcat.
CLEAR fcat.
fcat-fieldname = 'KBETR'.
fcat-outputlen = 8.
fcat-seltext_s = 'RATE'.
fcat-seltext_m = 'Rate'.
fcat-seltext_l = 'RATE'.
fcat-ddictxt = 'M'.
fcat-inttype = 'P'.
fcat-datatype = 'CURR'.
APPEND fcat.
CLEAR fcat.
fcat-fieldname = 'NSR'.
fcat-outputlen = 8.
fcat-seltext_s = 'Exmill'.
fcat-seltext_m = 'Exmill'.
fcat-seltext_l = 'Exmill'.
fcat-ddictxt = 'M'.
fcat-inttype = 'P'.
fcat-datatype = 'CURR'.
APPEND fcat.
CLEAR fcat.
fcat-fieldname = 'KURSK'.
fcat-outputlen = 8.
fcat-seltext_s = 'EXCHANGE RATE'.
fcat-seltext_m = 'Exchange Rate'.
fcat-seltext_l = 'Exchange Rate'.
fcat-ddictxt = 'M'.
fcat-inttype = 'P'.
fcat-datatype = 'CURR'.
APPEND fcat.
CLEAR fcat.
fcat-fieldname = 'WAERK'.
fcat-outputlen = 5.
fcat-seltext_s = 'CURRENCY'.
fcat-seltext_m = 'Currency'.
fcat-seltext_l = 'CURRENCY'.
fcat-ddictxt = 'M'.
fcat-inttype = 'C'.
fcat-datatype = 'CUKY'.
APPEND fcat.
CLEAR fcat.
fcat-fieldname = 'LCURR1'.
fcat-outputlen = 14.
fcat-seltext_s = 'GROSS AMT'.
fcat-seltext_m = 'Gross Amt'.
fcat-seltext_l = 'GROSS AMT'.
fcat-ddictxt = 'L'.
fcat-inttype = 'P'.
fcat-datatype = 'CURR'.
fcat-do_sum = 'X'.
APPEND fcat.
================================= *****************
fheader-typ = 'H'.
SELECT SINGLE butxt
FROM t001
INTO fheader-info
WHERE bukrs EQ '1000'.
APPEND fheader.
CLEAR fheader.
fheader-typ = 'H'.
fheader-info = 'Daily Shipments For Exp'.
APPEND fheader.
CLEAR fheader.
Plant
SORT s_werks BY low.
READ TABLE s_werks INDEX 1.
fheader-typ = 'S'.
WRITE s_werks-low TO fheader-key.
SORT s_werks BY high DESCENDING.
READ TABLE s_werks INDEX 1.
IF s_werks-high NE space.
CONCATENATE fheader-key 'TO' s_werks-high INTO fheader-info
SEPARATED BY space.
ELSE.
WRITE fheader-key TO fheader-info.
ENDIF.
CLEAR fheader-key.
fheader-key = 'PLANT : '.
APPEND fheader.
CLEAR fheader.
Billing Typ
SORT S_FKART BY LOW.
READ TABLE S_FKART INDEX 1.
FHEADER-TYP = 'S'.
WRITE S_FKART-LOW TO FHEADER-KEY.
SORT S_FKART BY HIGH DESCENDING.
READ TABLE S_FKART INDEX 1.
IF S_FKART-HIGH NE SPACE.
CONCATENATE FHEADER-KEY 'TO' S_FKART-HIGH INTO FHEADER-INFO
SEPARATED BY SPACE.
ELSE.
WRITE FHEADER-KEY TO FHEADER-INFO.
ENDIF.
CLEAR FHEADER-KEY.
FHEADER-KEY = 'DOCUMENT TYPE : '.
APPEND FHEADER.
CLEAR FHEADER.
Date...
fheader-typ = 'S'.
FHEADER-KEY = S_FKDAT-LOW.
WRITE s_fkdat-low TO fheader-key.
WRITE s_fkdat-high TO w_dthigh.
CONCATENATE fheader-key 'TO' w_dthigh INTO fheader-info
SEPARATED BY space.
CLEAR fheader-key.
fheader-key = 'PERIOD : '.
APPEND fheader.
CLEAR fheader.
CALL FUNCTION 'REUSE_ALV_EVENTS_GET'
EXPORTING
i_list_type = 0
IMPORTING
et_events = fevents[]
EXCEPTIONS
list_type_wrong = 1
OTHERS = 2.
READ TABLE fevents WITH KEY name = 'TOP_OF_PAGE'.
IF sy-subrc = 0.
fevents-form = 'TOPOFPAGE'.
MODIFY fevents INDEX sy-tabix.
CLEAR fevents.
ENDIF.
rptname = sy-repid.
CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
EXPORTING
i_callback_program = rptname
it_fieldcat = fcat[]
i_default = 'S'
it_events = fevents[]
i_save = 'X'
TABLES
t_outtab = it_output[]
EXCEPTIONS
PROGRAM_ERROR = 1
OTHERS = 2
ENDFORM. " BUILD_FIELD_CATALOG -
Addition of a Field in EKKO/Data not getting populated for that field
Hi All,
I have added a Z Field in EKKO Table through the Append Structure "CI_EKPODB".
There are around 2000 records in EKKO and for all the records that Z field is Blank.
But, when I write a Select Query in Program to Fetch the Records where that Z Field is BLANK, I get only 50 Records.
The same happens when I Execute SE16 for EKKO by giving condition Z Field = INITIAL. I get only 50 records in the output.
Please help me understand why I dont get all the Records where that Z Field is INITIAL?
Is any customization required or is this a Technical Issue?
Please help.
Thanks in Advance.hi rohan,
if you are adding a field in a table by append structure then make that field as ZZ instead of Z to differentiate it from normal fields.
now when you have created the field in a append structure then if have not checked the initial flag.thats why u are getting this data inconsistency.
this is because earlier 2000 entries are prestent in the table , now when you add another field in the table then that field will not have value for those 2000 records.
now when you create the fiels select the init flag field,if you select this then new flag field will NOT NULL,so initial values will be filled for that field for existing 2000 records.
Note : NULL and INITIAL are different things, NULL means not defined and initial means which is having its initial value.
check that init flag and u will get those 2000 records, you are getting inconsistent data now becuse value for that field is null ie not defined.
hopr this will solve ur post and u wil get the concept of append structure.
Thanks and regards,
Tanmaya -
F4 for Editable field in ALV, display Name but capture ID
Hi Friends,
I have a ALV for which i have defined a Structure, which is passed to Fieldcatlog.
I have defined a Search help - ZUSER_NAME which has following fields to display.
USERID - USR02-BNAME
FNAME
LNAME
FULLNAME
So my structure for fieldcatalog has User-id which is linked to this search help with Domain XUBNAME.
So in my report i made this User-Id as editable and F4 available, everything is working fine.
when user does a F4, its displaying Userid,Fname,Lname and complete name.upon selection and save i am capturing the id and storing in the ztable.
But now i have a requirement that when user selects a value from this search help on F4, i need to display Fullname but capture the User Id. How can i do that?
This is something similar to the one we have in BSP- key-value pair.
how to do this in ALV.
Appreciate if someone can guide me thru.
Thanks,
Simha
Edited by: Simha on Sep 6, 2008 2:24 PMhai , this is example code for editing the F4 display .. check out this
REPORT zalv_editf4display.
*Type pools for alv
TYPE-POOLS : slis.
*structure for t582a tbale
TYPES : BEGIN OF ty_table,
infty TYPE infty,
pnnnn TYPE pnnnn_d,
zrmkz TYPE dzrmkz,
zeitb TYPE dzeitb,
dname TYPE dianm,
davo TYPE davo,
davoe TYPE davoe,
END OF ty_table.
*Structure for infotype text
TYPES : BEGIN OF ty_itext,
infty TYPE infty,
itext TYPE intxt,
sprsl TYPE sprsl,
END OF ty_itext.
*Structure for output display
TYPES : BEGIN OF ty_output,
infty TYPE infty,
itext TYPE intxt,
pnnnn TYPE pnnnn_d,
zrmkz TYPE dzrmkz,
zeitb TYPE dzeitb,
dname TYPE dianm,
davo TYPE davo,
davoe TYPE davoe,
END OF ty_output.
*internal table and work area declarations
DATA : it_table TYPE STANDARD TABLE OF ty_table INITIAL SIZE 0,
it_output TYPE STANDARD TABLE OF ty_output INITIAL SIZE 0,
it_pbo TYPE STANDARD TABLE OF ty_output INITIAL SIZE 0,
it_ittext TYPE STANDARD TABLE OF ty_itext INITIAL SIZE 0,
wa_table TYPE ty_table,
wa_output TYPE ty_output,
wa_ittext TYPE ty_itext.
*Data declarations for dropdown lists for f4
DATA: it_dropdown TYPE lvc_t_drop,
ty_dropdown TYPE lvc_s_drop,
*data declaration for refreshing of alv
stable TYPE lvc_s_stbl.
*Global variable declaration
DATA: gstring TYPE c.
*Data declarations for ALV
DATA: c_ccont TYPE REF TO cl_gui_custom_container, "Custom container object
c_alvgd TYPE REF TO cl_gui_alv_grid, "ALV grid object
it_fcat TYPE lvc_t_fcat, "Field catalogue
it_layout TYPE lvc_s_layo. "Layout
*ok code declaration
DATA:
ok_code TYPE ui_func.
*initialization event
INITIALIZATION.
*start of selection event
START-OF-SELECTION.
*select the infotypes maintained
SELECT infty
pnnnn
zrmkz
zeitb
dname
davo
davoe
FROM t582a UP TO 10 ROWS
INTO CORRESPONDING FIELDS OF TABLE it_table.
*Select the infotype texts
IF it_table[] IS NOT INITIAL.
SELECT itext
infty
sprsl
FROM t582s
INTO CORRESPONDING FIELDS OF TABLE it_ittext
FOR ALL ENTRIES IN it_table
WHERE infty = it_table-infty
AND sprsl = 'E'.
ENDIF.
*Apppending the data to the internal table of ALV output
LOOP AT it_table INTO wa_table.
wa_output-infty = wa_table-infty.
wa_output-pnnnn = wa_table-pnnnn.
wa_output-zrmkz = wa_table-zrmkz.
wa_output-zeitb = wa_table-zeitb.
wa_output-dname = wa_table-dname.
wa_output-davo = wa_table-davo.
wa_output-davoe = wa_table-davoe.
For texts
READ TABLE it_ittext INTO wa_ittext WITH KEY infty = wa_table-infty.
wa_output-itext = wa_ittext-itext.
APPEND wa_output TO it_output.
CLEAR wa_output.
ENDLOOP.
Calling the ALV screen with custom container
CALL SCREEN 0600.
*On this statement double click it takes you to the screen painter SE51.
*Enter the attributes
*Create a Custom container and name it CCONT and OK code as OK_CODE.
*Save check and Activate the screen painter.
*Now a normal screen with number 600 is created which holds the ALV grid.
PBO of the actual screen ,
Here we can give a title and customized menus
*create 2 buttons with function code 'SAVE' and 'EXIT'.
GIVE A SUITABLE TITLE
*& Module STATUS_0600 OUTPUT
text
MODULE status_0600 OUTPUT.
SET PF-STATUS 'DISP'.
SET TITLEBAR 'ALVF4'.
ENDMODULE. " STATUS_0600 OUTPUT
calling the PBO module ALV_GRID.
*& Module PBO OUTPUT
text
MODULE pbo OUTPUT.
*Creating objects of the container
CREATE OBJECT c_ccont
EXPORTING
container_name = 'CCONT'.
create object for alv grid
create object c_alvgd
exporting
i_parent = c_ccont.
SET field for ALV
PERFORM alv_build_fieldcat.
Set ALV attributes FOR LAYOUT
PERFORM alv_report_layout.
CHECK NOT c_alvgd IS INITIAL.
Call ALV GRID
CALL METHOD c_alvgd->set_table_for_first_display
EXPORTING
is_layout = it_layout
i_save = 'A'
CHANGING
it_outtab = it_output
it_fieldcatalog = it_fcat
EXCEPTIONS
invalid_parameter_combination = 1
program_error = 2
too_many_lines = 3
OTHERS = 4.
IF sy-subrc <> 0.
MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
ENDIF.
ENDMODULE. " PBO OUTPUT
*& Form alv_build_fieldcat
text
<--P_IT_FCAT text
*subroutine to build fieldcat
FORM alv_build_fieldcat.
DATA lv_fldcat TYPE lvc_s_fcat.
CLEAR lv_fldcat.
lv_fldcat-row_pos = '1'.
lv_fldcat-col_pos = '1'.
lv_fldcat-fieldname = 'INFTY'.
lv_fldcat-tabname = 'IT_OUTPUT'.
lv_fldcat-outputlen = 8.
lv_fldcat-scrtext_m = 'Infotype'.
lv_fldcat-icon = 'X'.
APPEND lv_fldcat TO it_fcat.
CLEAR lv_fldcat.
lv_fldcat-row_pos = '1'.
lv_fldcat-col_pos = '2'.
lv_fldcat-fieldname = 'PNNNN'.
lv_fldcat-tabname = 'IT_OUTPUT'.
lv_fldcat-outputlen = 15.
lv_fldcat-scrtext_m = 'Structure'.
lv_fldcat-icon = ''.
APPEND lv_fldcat TO it_fcat.
CLEAR lv_fldcat.
lv_fldcat-row_pos = '1'.
lv_fldcat-col_pos = '3'.
lv_fldcat-fieldname = 'ITEXT'.
lv_fldcat-tabname = 'IT_OUTPUT'.
lv_fldcat-outputlen = 60.
lv_fldcat-scrtext_m = 'Description'.
lv_fldcat-icon = ''.
APPEND lv_fldcat TO it_fcat.
CLEAR lv_fldcat.
lv_fldcat-row_pos = '1'.
lv_fldcat-col_pos = '5'.
lv_fldcat-fieldname = 'ZRMKZ'.
lv_fldcat-tabname = 'IT_OUTPUT'.
lv_fldcat-outputlen = 1.
lv_fldcat-scrtext_m = 'PERIOD'.
lv_fldcat-icon = ''.
APPEND lv_fldcat TO it_fcat.
CLEAR lv_fldcat.
lv_fldcat-row_pos = '1'.
lv_fldcat-col_pos = '6'.
lv_fldcat-fieldname = 'ZEITB'.
lv_fldcat-tabname = 'IT_OUTPUT'.
lv_fldcat-outputlen = 5.
lv_fldcat-scrtext_m = 'Time constraint'.
lv_fldcat-edit = 'X'.
*To avail the existing F4 help these are to
*be given in the field catalogue
lv_fldcat-f4availabl = 'X'.
lv_fldcat-ref_table = 'T582A'.
lv_fldcat-ref_field = 'ZEITB'.
APPEND lv_fldcat TO it_fcat.
CLEAR lv_fldcat.
lv_fldcat-row_pos = '1'.
lv_fldcat-col_pos = '7'.
lv_fldcat-fieldname = 'DNAME'.
lv_fldcat-tabname = 'IT_OUTPUT'.
lv_fldcat-outputlen = 15.
lv_fldcat-scrtext_m = 'Dialogmodule'.
lv_fldcat-icon = ''.
APPEND lv_fldcat TO it_fcat.
CLEAR lv_fldcat.
lv_fldcat-row_pos = '1'.
lv_fldcat-col_pos = '8'.
lv_fldcat-fieldname = 'DAVO'.
lv_fldcat-tabname = 'IT_OUTPUT'.
lv_fldcat-outputlen = 15.
lv_fldcat-scrtext_m = 'Start'.
lv_fldcat-edit = 'X'.
APPEND lv_fldcat TO it_fcat.
CLEAR lv_fldcat.
lv_fldcat-row_pos = '1'.
lv_fldcat-col_pos = '9'.
lv_fldcat-fieldname = 'DAVOE'.
lv_fldcat-tabname = 'IT_OUTPUT'.
lv_fldcat-outputlen = 15.
lv_fldcat-scrtext_m = 'End'.
lv_fldcat-icon = ''.
APPEND lv_fldcat TO it_fcat.
CLEAR lv_fldcat.
*To create drop down for the field 'DAVO'
with our own f4 help
ty_dropdown-handle = '1'.
ty_dropdown-value = ' '.
APPEND ty_dropdown TO it_dropdown.
ty_dropdown-handle = '1'.
ty_dropdown-value = '1'.
APPEND ty_dropdown TO it_dropdown.
ty_dropdown-handle = '1'.
ty_dropdown-value = '2'.
APPEND ty_dropdown TO it_dropdown.
ty_dropdown-handle = '1'.
ty_dropdown-value = '3'.
APPEND ty_dropdown TO it_dropdown.
CALL METHOD c_alvgd->set_drop_down_table
EXPORTING
it_drop_down = it_dropdown.
LOOP AT it_fcat INTO lv_fldcat.
CASE lv_fldcat-fieldname.
To assign dropdown in the fieldcataogue
WHEN 'DAVO'.
lv_fldcat-drdn_hndl = '1'.
lv_fldcat-outputlen = 15.
MODIFY it_fcat FROM lv_fldcat.
ENDCASE.
ENDLOOP.
ENDFORM. " alv_build_fieldcat
*& Form alv_report_layout
text
<--P_IT_LAYOUT text
*Subroutine for setting alv layout
FORM alv_report_layout.
it_layout-cwidth_opt = 'X'.
it_layout-col_opt = 'X'.
it_layout-zebra = 'X'.
ENDFORM. " alv_report_layout
PAI module of the screen created. In case we use an interactive ALV or
*for additional functionalities we can create OK codes
*and based on the user command we can do the coding.
*& Module PAI INPUT
text
MODULE pai INPUT.
*To change the existing values and refresh the grid
*And only values in the dropdown or in the default
*F4 can be given , else no action takes place for the dropdown
*and error is thrown for the default F4 help and font changes to red
*and on still saving, value is not changed
c_alvgd->check_changed_data( ).
*Based on the user input
*When user clicks 'SAVE;
CASE ok_code.
WHEN 'SAVE'.
*A pop up is called to confirm the saving of changed data
CALL FUNCTION 'POPUP_TO_CONFIRM'
EXPORTING
titlebar = 'SAVING DATA'
text_question = 'Continue?'
icon_button_1 = 'icon_booking_ok'
IMPORTING
answer = gstring
EXCEPTIONS
text_not_found = 1
OTHERS = 2.
IF sy-subrc NE 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
*When the User clicks 'YES'
IF ( gstring = '1' ).
MESSAGE 'Saved' TYPE 'S'.
*Now the changed data is stored in the it_pbo internal table
it_pbo = it_output.
*Subroutine to display the ALV with changed data.
PERFORM redisplay.
ELSE.
*When user clicks NO or Cancel
MESSAGE 'Not Saved' TYPE 'S'.
ENDIF.
**When the user clicks the 'EXIT; he is out
WHEN 'EXIT'.
LEAVE PROGRAM.
ENDCASE.
CLEAR: ok_code.
ENDMODULE. " PAI INPUT
*& Form REDISPLAY
text
--> p1 text
<-- p2 text
FORM redisplay .
*Cells of the alv are made non editable after entering OK to save
CALL METHOD c_alvgd->set_ready_for_input
EXPORTING
i_ready_for_input = 0.
*Row and column of the alv are refreshed after changing values
stable-row = 'X'.
stable-col = 'X'.
*REfreshed ALV display with the changed values
*This ALV is non editable and contains new values
CALL METHOD c_alvgd->refresh_table_display
EXPORTING
is_stable = stable
EXCEPTIONS
finished = 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. " REDISPLAY -
Not getting data for 1 field in ODS
Hi BW Experts,
I am loading the data from R/3 to BW.I have loaded the data through PSA.The data is available in New data field. After activating the ODS, for 1 field the data is not uploaded and in the report, the values are not displaying.
I have checked the Transformations also. it is mapped correctly.But still i am not getting data for that field.
Thanks,
Siva.Thanks for the Update
1. What is your Service Pack Level?
Service Pack is 0016
2. Are you able to see the data in PSA?
Yes I can see the data in PSA
3. After load, are you able to see the value in New table?
Yes i can able to see the data in New data table
4. Anywhere, are you doing the SORTING of Data Package?
No I have not sorted the data Package.I have not written any coding on this
I have not written any coding in transformation also.
Thanks,
Siva. -
Help for date field not working after upgrade
hi experts,
In our BSP application for a page we had an inputfield (date).
Onvaluehelp for input field we were calling the saphelpdate function.
however after upgrade this functionality is not working properly as no pop up comes after clicking on the icon.
we have upgraded to SPS 16 recently.
please help me.
regards,
Arvind.Hi, I try upper case but nothing happen. This is all my code by far, I hope you can help me:
DATA: BEGIN OF T_PCONT OCCURS 0,
PCONT LIKE ZPSPERMISOS-PSOBKEY,
END OF T_PCONT.
DATA: BEGIN OF T_FIELDS OCCURS 0.
INCLUDE STRUCTURE help_value.
DATA END OF T_FIELDS.
DATA: BEGIN OF T_VALUES OCCURS 0,
VALUE(60) TYPE c.
DATA: END OF T_VALUES.
DATA: N TYPE i.
SELECTION-SCREEN BEGIN OF BLOCK b20 WITH FRAME TITLE text-b02.
SELECT-OPTIONS:
P_CONT FOR ZPSPERMISOSH-PSOBKEY OBLIGATORY NO-EXTENSION NO INTERVALS,
P_INT FOR ZPSPERMISOSH-PARTNER OBLIGATORY NO-EXTENSION NO INTERVALS,
P_FEC FOR ZPSPERMISOSH-ZFINICN NO-EXTENSION NO INTERVALS,
P_RAZ FOR ZPSPERMISOSH-ZRAZONFINIC NO-EXTENSION NO INTERVALS.
SELECTION-SCREEN END OF BLOCK b20.
AT SELECTION-SCREEN ON VALUE-REQUEST FOR P_CONT-LOW.
PERFORM P_HELP_P_CONT USING P_CONT-LOW.
*& Form P_HELP_P_CONT
FORM P_HELP_P_CONT USING P_P_CONT.
DESCRIBE TABLE T_PCONT LINES N.
IF N EQ 0.
T_FIELDS-FIELDNAME = 'PSOBKEY'.
T_FIELDS-TABNAME = 'ZPSPERMISOS'.
T_FIELDS-SELECTFLAG = 'X'.
APPEND T_FIELDS.
CLEAR T_FIELDS.
SELECT PSOBKEY FROM ZPSPERMISOS
INTO TABLE T_PCONT.
SORT T_PCONT BY PCONT.
CALL FUNCTION 'HELP_VALUES_GET_WITH_TABLE'
EXPORTING
CUCOL = 10
CUROW = 1
TABNAME = 'T_PCONT'
FIELDNAME = 'PCONT'
IMPORTING
SELECT_VALUE = P_P_CONT
TABLES
FIELDS = T_FIELDS
VALUETAB = T_VALUES.
ENDFORM. " P_HELP_P_CONT
Edited by: J. Garibaldi on Nov 25, 2009 11:14 AM
Edited by: J. Garibaldi on Nov 25, 2009 11:16 AM -
Reg : F4 help for custom fields in ALV report
hi friends..
in my internal table i have fields including 1 custom field..
DATA : BEGIN OF i_final OCCURS 0,
pernr LIKE p0000-pernr,
begda LIKE p0000-begda,
plans LIKE ZPOSITION-plans, (custom)
werks LIKE pspar-werks,
end of i_final.
i want to display this i_final table in alv. for that i genetrate one fieldcatalog
PERFORM fcat USING:
'I_FINAL' 'PERNR' 'P0000' 'PERNR' '15' 'X' '',
'I_FINAL' 'BEGDA' 'P0000' 'BEGDA' '10' 'X' '',
'I_FINAL' 'PLANS' 'ZPOSITION' 'PLANS' '8' 'X' '',
'I_FINAL' 'WERKS' 'PSPAR' 'WERKS' '14' 'X' ''.
in custom table zposition, i maintain serch help for custom field "PLANS".
then i used reuse_alv_grid_display.. for all the std fields along wit custom fields
i got f4 all std fields but for my custom i am not getting the f4 help
how can i get the F$ help for this custom fields Zposition-plans..
plz give some ideaHi
In that Ztable against the field
PLANS give the check table name as <b>T528B</b>
then it will automatically give the search help
or you can create your own search help(elementary) and add to that field
Reward if useful
regards
Anji -
Color for a Field in alv output
Hi All,
I use a field in the ALV grid output which needs to display color (red or green) depending on certain validations. Please tell me how to display color for this field. The program uses oops.
Thanks.Hi
1. add one more field to ur final internal table say COLOR(4)
2. in layout wa_layout-style_fname = 'COLOR'. " if its grid
wa_layout-style_fieldname = 'COLOR'. "if its list
3. read table itab index 3.
itab-color = 'C410'.
modify itab index 3
4. see program SHOWCOLO for all color codes
1. Add a field of data type CHAR(3) to the internal output table.
2. Enter the color code in the appropriate field of the row to be colored in the internal
output table:
Code: 'Cxy'
C = Color (all codes begin with 'C')
x = color number ('1' - '9')
y = highlight ('0' = off, '1' = on)
3. Assign the internal output table color code field name to the IS_LAYOUT importing
structure IS_LAYOUT-INFO_FIELDNAME field and pass this structure in the ALV call
interface.
To enable row coloring, you should add an additional field to your list data table. It should be of character type and length at least 4. This field will contain the color code for the row. So, lets modify declaration of our list data table gt_list.
you should fill the color code to this field. Its format will be the same as explained before at section C.6.3. But how will ALV Grid know that you have loaded the color data for the row to this field. So, you make it know this by passing the name of the field containing color codes to the field INFO_FNAME of the layout structure.
e.g.
ps_layout-info_fname = <field_name_containing_color_codes>. e.g. ROWCOLOR
You can fill that field anytime during execution. But, of course, due to the flow logic of screens, it will be reflected to your list display as soon as an ALV refresh occurs.
You can color an entire row as described in the next section. However, this method is less time consuming.
Coloring Individual Cells
This is the last point about coloring procedures for the ALV Grid. The procedure is similar to coloring an entire row. However, since an individual cell can be addressed with two parameters we will need something more. What is meant by more is a table type structure to be included into the structure of the list data table. It seems strange, because including it will make our list data structure deep. But anyhow ALV Grid control handles this.
The structure that should be included must be of type LVC_T_SCOL. If you want to color the entire row, this inner table should contain only one row with field fname is set to space, some color value at field col, 0 or 1 at fields int (intensified) and inv (inverse).
If you want to color individual cells, then for each cell column, append a line to this inner table which also contains the column name at field fname. It is obvious that you can color an entire column by filling this inner table with a row for that column for each row in the list data table.
Reward points if useful
Regards
Anji -
Alv subtotals and grand total for a field
Hi friends,
I Have an internal table ITAB1
in that i have a senario as below.
In my GRID display iam getting values in the layou as follows
BUKRS = 1000
LIFNR MATNR STCST
100 abc 500,00
100 pqr 400,00
100 xyz 200,00
sub total
200 pto 700,00
200 vbr 900,00
sub total
BUKRS = 2000
LIFNR MATNR STCST
150 abc 500,00
150 pqr 400,00
150 xyz 200,00
sub total
260 pto 700,00
260 vbr 900,00
sub total
GRAND TOTAL =
Now my requirement is at the end of every vendor i need sub total for STCST field.
and at the end of every company code i need GRAND TOTAL for STCST field.
Its alv grid display.
how can i do that.
Regards,
Priyanka.Check this sample code may it will help u:
*& Report Z_ALV_SUBTOTAL
REPORT z_alv_subtotal.
*& Table declaration
TABLES: ekko.
*& Type pool declaration
TYPE-POOLS: slis. " Type pool for ALV
*& Selection screen
SELECT-OPTIONS: s_ebeln FOR ekko-ebeln.
*& Type declaration
* Type declaration for internal table to store EKPO data
TYPES: BEGIN OF x_data,
ebeln TYPE char30, " Document no.
ebelp TYPE ebelp, " Item no
matnr TYPE matnr, " Material no
matnr1 TYPE matnr, " Material no
werks TYPE werks_d, " Plant
werks1 TYPE werks_d, " Plant
ntgew TYPE entge, " Net weight
gewe TYPE egewe, " Unit of weight
END OF x_data.
*& Internal table declaration
DATA:
* Internal table to store EKPO data
i_ekpo TYPE STANDARD TABLE OF x_data INITIAL SIZE 0,
* Internal table for storing field catalog information
i_fieldcat TYPE slis_t_fieldcat_alv,
* Internal table for Top of Page info. in ALV Display
i_alv_top_of_page TYPE slis_t_listheader,
* Internal table for ALV Display events
i_events TYPE slis_t_event,
* Internal table for storing ALV sort information
i_sort TYPE slis_t_sortinfo_alv,
i_event TYPE slis_t_event.
*& Work area declaration
DATA:
wa_ekko TYPE x_data,
wa_layout TYPE slis_layout_alv,
wa_events TYPE slis_alv_event,
wa_sort TYPE slis_sortinfo_alv.
*& Constant declaration
CONSTANTS:
c_header TYPE char1
VALUE 'H', "Header in ALV
c_item TYPE char1
VALUE 'S'.
*& Start-of-selection event
START-OF-SELECTION.
* Select data from ekpo
SELECT ebeln " Doc no
ebelp " Item
matnr " Material*
matnr " Material*
werks " Plant*
werks " Plant*
ntgew " Quantity
gewei " Unit
FROM ekpo
INTO TABLE i_ekpo
WHERE ebeln IN s_ebeln
AND ntgew NE '0.00'.
IF sy-subrc = 0.
SORT i_ekpo BY ebeln ebelp matnr .
ENDIF.
* To build the Page header
PERFORM sub_build_header.
* To prepare field catalog
PERFORM sub_field_catalog.
* Perform to populate the layout structure
PERFORM sub_populate_layout.
* Perform to populate the sort table.
PERFORM sub_populate_sort.
* Perform to populate ALV event
PERFORM sub_get_event.
END-OF-SELECTION.
* Perform to display ALV report
PERFORM sub_alv_report_display.
*& Form sub_build_header
* To build the header
* No Parameter
FORM sub_build_header .
* Local data declaration
DATA: l_system TYPE char10 , "System id
l_r_line TYPE slis_listheader, "Hold list header
l_date TYPE char10, "Date
l_time TYPE char10, "Time
l_success_records TYPE i, "No of success records
l_title(300) TYPE c. " Title
* Title Display
l_r_line-typ = c_header. " header
l_title = 'Test report'(001).
l_r_line-info = l_title.
APPEND l_r_line TO i_alv_top_of_page.
CLEAR l_r_line.
* Run date Display
CLEAR l_date.
l_r_line-typ = c_item. " Item
WRITE: sy-datum TO l_date MM/DD/YYYY.
l_r_line-key = 'Run Date :'(002).
l_r_line-info = l_date.
APPEND l_r_line TO i_alv_top_of_page.
CLEAR: l_r_line,
l_date.
ENDFORM. " sub_build_header
*& Form sub_field_catalog
* Build Field Catalog
* No Parameter
FORM sub_field_catalog .
* Build Field Catalog
PERFORM sub_fill_alv_field_catalog USING:
'01' '01' 'EBELN' 'I_EKPO' 'L'
'Doc No'(003) ' ' ' ' ' ' ' ',
'01' '02' 'EBELP' 'I_EKPO' 'L'
'Item No'(004) 'X' 'X' ' ' ' ',
'01' '03' 'MATNR' 'I_EKPO' 'L'
'Material No'(005) 'X' 'X' ' ' ' ',
'01' '03' 'MATNR1' 'I_EKPO' 'L'
'Material No'(005) ' ' ' ' ' ' ' ',
'01' '04' 'WERKS' 'I_EKPO' 'L'
'Plant'(006) 'X' 'X' ' ' ' ',
'01' '04' 'WERKS1' 'I_EKPO' 'L'
'Plant'(006) ' ' ' ' ' ' ' ',
'01' '05' 'NTGEW' 'I_EKPO' 'R'
'Net Weight'(007) ' ' ' ' 'GEWE' 'I_EKPO'.
ENDFORM. " sub_field_catalog
*& Form sub_fill_alv_field_catalog
*& For building Field Catalog
*& p_rowpos Row position
*& p_colpos Col position
*& p_fldnam Fldname
*& p_tabnam Tabname
*& p_justif Justification
*& p_seltext Seltext
*& p_out no out
*& p_tech Technical field
*& p_qfield Quantity field
*& p_qtab Quantity table
FORM sub_fill_alv_field_catalog USING p_rowpos TYPE sycurow
p_colpos TYPE sycucol
p_fldnam TYPE fieldname
p_tabnam TYPE tabname
p_justif TYPE char1
p_seltext TYPE dd03p-scrtext_l
p_out TYPE char1
p_tech TYPE char1
p_qfield TYPE slis_fieldname
p_qtab TYPE slis_tabname.
* Local declaration for field catalog
DATA: wa_lfl_fcat TYPE slis_fieldcat_alv.
wa_lfl_fcat-row_pos = p_rowpos. "Row
wa_lfl_fcat-col_pos = p_colpos. "Column
wa_lfl_fcat-fieldname = p_fldnam. "Field Name
wa_lfl_fcat-tabname = p_tabnam. "Internal Table Name
wa_lfl_fcat-just = p_justif. "Screen Justified
wa_lfl_fcat-seltext_l = p_seltext. "Field Text
wa_lfl_fcat-no_out = p_out. "No output
wa_lfl_fcat-tech = p_tech. "Technical field
wa_lfl_fcat-qfieldname = p_qfield. "Quantity unit
wa_lfl_fcat-qtabname = p_qtab . "Quantity table
IF p_fldnam = 'NTGEW'.
wa_lfl_fcat-do_sum = 'X'.
ENDIF.
APPEND wa_lfl_fcat TO i_fieldcat.
CLEAR wa_lfl_fcat.
ENDFORM. " sub_fill_alv_field_catalog
*& Form sub_populate_layout
* Populate ALV layout
* No Parameter
FORM sub_populate_layout .
CLEAR wa_layout.
wa_layout-colwidth_optimize = 'X'." Optimization of Col width
ENDFORM. " sub_populate_layout
*& Form sub_populate_sort
* Populate ALV sort table
* No Parameter
FORM sub_populate_sort .
* Sort on material
wa_sort-spos = '01' .
wa_sort-fieldname = 'MATNR'.
wa_sort-tabname = 'I_EKPO'.
wa_sort-up = 'X'.
wa_sort-subtot = 'X'.
APPEND wa_sort TO i_sort .
CLEAR wa_sort.
* Sort on plant
wa_sort-spos = '02'.
wa_sort-fieldname = 'WERKS'.
wa_sort-tabname = 'I_EKPO'.
wa_sort-up = 'X'.
wa_sort-subtot = 'X'.
APPEND wa_sort TO i_sort .
CLEAR wa_sort.
ENDFORM. " sub_populate_sort
*& Form sub_get_event
* Get ALV grid event and pass the form name to subtotal_text
* event
* No Parameter
FORM sub_get_event .
CONSTANTS : c_formname_subtotal_text TYPE slis_formname VALUE
'SUBTOTAL_TEXT'.
DATA: l_s_event TYPE slis_alv_event.
CALL FUNCTION 'REUSE_ALV_EVENTS_GET'
EXPORTING
i_list_type = 4
IMPORTING
et_events = i_event
EXCEPTIONS
list_type_wrong = 0
OTHERS = 0.
* Subtotal
READ TABLE i_event INTO l_s_event
WITH KEY name = slis_ev_subtotal_text.
IF sy-subrc = 0.
MOVE c_formname_subtotal_text TO l_s_event-form.
MODIFY i_event FROM l_s_event INDEX sy-tabix.
ENDIF.
ENDFORM. " sub_get_event
*& Form sub_alv_report_display
* For ALV Report Display
* No Parameter
FORM sub_alv_report_display .
DATA: l_repid TYPE syrepid .
l_repid = sy-repid .
* This function module for displaying the ALV report
CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
EXPORTING
i_callback_program = l_repid
i_callback_top_of_page = 'SUB_ALV_TOP_OF_PAGE'
is_layout = wa_layout
it_fieldcat = i_fieldcat
it_sort = i_sort
it_events = i_event
i_default = 'X'
i_save = 'A'
TABLES
t_outtab = i_ekpo
EXCEPTIONS
program_error = 1
OTHERS = 2.
IF sy-subrc <> 0.
* MESSAGE i000 WITH 'Error in ALV report display'(055).
ENDIF.
ENDFORM. " sub_alv_report_display
* FORM sub_alv_top_of_page
* Call ALV top of page
* No parameter
FORM sub_alv_top_of_page. "#EC CALLED
* To write header for the ALV
CALL FUNCTION 'REUSE_ALV_COMMENTARY_WRITE'
EXPORTING
it_list_commentary = i_alv_top_of_page.
ENDFORM. "alv_top_of_page
*& Form subtotal_text
* Build subtotal text
* P_total Total
* p_subtot_text Subtotal text info
FORM subtotal_text CHANGING
p_total TYPE any
p_subtot_text TYPE slis_subtot_text.
* Material level sub total
IF p_subtot_text-criteria = 'MATNR'.
p_subtot_text-display_text_for_subtotal
= 'Material level total'(009).
ENDIF.
* Plant level sub total
IF p_subtot_text-criteria = 'WERKS'.
p_subtot_text-display_text_for_subtotal = 'Plant level total'(010).
ENDIF.
ENDFORM. "subtotal_text
Edited by: Joyjit Ghosh on Aug 21, 2008 5:25 PM -
ALV Report displays space instead of '0.00' for qty field. why?
Hello friends,
I am facing a problem to display 0 value for the field
field - ZZQTY (Predefined Type at Domain level)
QUAN 21,2
In the program I am clearing the field and I can see its value as 0.00 while debugging.
As soon as field ZZQTY is displayed on ALV, it becomes blank (Space).
My requirement is to display '0.00' on ALV report.
What should I do?
Regards,
Ronny HanksHello
Search for
LS_FIELDCAT-NO_ZERO = 'X'.
for this field in programm and comment this. -
How to add a search help for a field in alv?
HI!Everyone ,
i want to add a search help created by myself for one field in alv,
and i want to use this function "HELP_VALUES_GET_WITH_TABLE".
can anyone help me ?
thanks!HI,Vijay.
My code like this :
PERFORM build_fcat.
PERFORM build_objects.
PERFORM layo_build.
PERFORM set_drdn_table .
CALL METHOD alv_grid->set_table_for_first_display
EXPORTING
i_structure_name = 'STU_S'
is_layout = s_layo
CHANGING
it_outtab = itab_out
it_fieldcatalog = i_fcat
."Period
IF sy-subrc <> 0.
EXIT.
ENDIF.
for example, there is a field 'UNAME' IN Structure 'STU_S',
i want to add a search help for 'UNAME'.
the 'UNAME' is not users in SAP R/3 , i want to add some data by myself or from a table .
Maybe you are looking for
-
What is best way to convert flac to alac and use metadata
I wish to convert my FLAC collection to a lac so as to use on my iPod etc. Have tried using numerous App Store apps - all truncate tracks and will not use track etc data in the conversion to be usable in iTunes Any advice appreciated. Olmzi
-
Profit center trail balance report using report painter
HI Experts, Please let me know steps to write functional specs for creating profit center trail balancing using report painter and also steps to create profit center trail balance using report painter. Thnaks, Vani
-
"Send Form Again?" Problem
When sending a "reply" to an online forum thread using Safari 3.1, frequently I am halfway through the reply and need to add a live link. When I go to another URL, copy the link, and try to return to my reply, I get the "Do you really want to send th
-
I want to crop my images to 840 px by 473 px but when I enter those numbers for a custom crop in Lightroom it defaults to 16x9. How can I change this? I've tried ratios close to 840x473 and multiples of that combination but nothing allows me to get
-
I am working on a documentary and have about 50 hours of footage recorded over MANY years. Does anyone have any tips as to what would be the most efficient way to log this material? Thanks, D