I want use I_callback_pf_status_set parameter in REUSE_ALV_LIST_DISPLAY.
i want use I_callback_pf_status_set parameter in REUSE_ALV_LIST_DISPLAY. how can i use it? can any one can give me one simple example.
Hi,
Have a look on the following
TYPE-POOLS: SLIS.
TYPES: BEGIN OF I_MARA,
MATNR LIKE MARA-MATNR,
MTART LIKE MARA-MTART,
MEINS LIKE MARA-MEINS,
GROES LIKE MARA-GROES,
VOLUM LIKE MARA-VOLUM,
END OF I_MARA.
DATA: IT_MARA TYPE STANDARD TABLE OF I_MARA INITIAL SIZE 0.
DATA: FLDCAT TYPE SLIS_T_FIELDCAT_ALV WITH HEADER LINE,
REPID TYPE SY-REPID,
GD_LAYOUT TYPE SLIS_LAYOUT_ALV.
START-OF-SELECTION.
PERFORM DATA_RETRIEVAL.
PERFORM BLD_FLDCAT.
PERFORM BLD_LAYOUT.
PERFORM DISPLAY_ALV_REPORT.
FORM BLD_FLDCAT.
FLDCAT-FIELDNAME = 'MATNR'.
FLDCAT-SELTEXT_M = 'MATERIAL NUMBER'.
FLDCAT-COL_POS = 0.
FLDCAT-KEY = 'X'.
APPEND FLDCAT TO FLDCAT.
CLEAR FLDCAT.
FLDCAT-FIELDNAME = 'MTART'.
FLDCAT-SELTEXT_M = 'MATERIAL TYPE'.
FLDCAT-COL_POS = 1.
FLDCAT-KEY = 'X'.
APPEND FLDCAT TO FLDCAT.
CLEAR FLDCAT.
FLDCAT-FIELDNAME = 'MEINS'.
FLDCAT-SELTEXT_M = 'UNIT OF MEASURE'.
FLDCAT-COL_POS = 2.
APPEND FLDCAT TO FLDCAT.
CLEAR FLDCAT.
FLDCAT-FIELDNAME = 'GROES'.
FLDCAT-SELTEXT_M = 'SIZE'.
FLDCAT-COL_POS = 3.
FLDCAT-KEY = 'X'.
APPEND FLDCAT TO FLDCAT.
CLEAR FLDCAT.
FLDCAT-FIELDNAME = 'VOLUM'.
FLDCAT-SELTEXT_M = 'VOLUME'.
FLDCAT-COL_POS = 4.
APPEND FLDCAT TO FLDCAT.
CLEAR FLDCAT.
ENDFORM.
FORM BLD_LAYOUT.
GD_LAYOUT-NO_INPUT = 'X'.
GD_LAYOUT-COLWIDTH_OPTIMIZE = 'X'.
GD_LAYOUT-ZEBRA = 'X'.
GD_LAYOUT-WINDOW_TITLEBAR = 'GRID DISPLAY'.
ENDFORM.
FORM DISPLAY_ALV_REPORT.
REPID = SY-REPID.
CALL FUNCTION 'REUSE_ALV_LIST_DISPLAY'
EXPORTING
I_CALLBACK_PROGRAM = REPID
I_CALLBACK_PF_STATUS_SET = 'STANDARD'
I_CALLBACK_USER_COMMAND = 'USER-COMMAND'
I_CALLBACK_TOP_OF_PAGE = 'TOP_OF_PAGE'
IS_LAYOUT = GD_LAYOUT
IT_FIELDCAT = FLDCAT[]
I_SAVE = 'X'
TABLES
T_OUTTAB = IT_MARA
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.
FORM DATA_RETRIEVAL.
SELECT MATNR MTART MEINS GROES VOLUM
INTO TABLE IT_MARA FROM MARA
UP TO 40 ROWS.
ENDFORM.
FORM TOP_OF_PAGE.
DATA: T_HEADER TYPE SLIS_T_LISTHEADER,
WA_HEADER TYPE SLIS_LISTHEADER.
WA_HEADER-TYP = 'H'.
WA_HEADER-INFO = 'THIS IS MY FIRST ALV'.
APPEND WA_HEADER TO T_HEADER.
WA_HEADER-TYP = 'S'.
WA_HEADER-INFO = 'THIS IS SECOND'.
APPEND WA_HEADER TO T_HEADER.
CALL FUNCTION 'REUSE_ALV_COMMENTARY_WRITE'
EXPORTING
IT_LIST_COMMENTARY = T_HEADER
I_LOGO =
I_END_OF_LIST_GRID =
I_ALV_FORM =
ENDFORM.
FORM STANDARD USING EXTAB TYPE SLIS_T_EXTAB.
SET PF-STATUS 'STANDA02' EXCLUDING EXTAB.
ENDFORM.
FORM USER-COMMAND USING R_COMM TYPE SY-UCOMM
RS_SELFIELD TYPE SLIS_SELFIELD.
CASE R_COMM.
WHEN 'F3'.
LEAVE PROGRAM.
ENDCASE.
ENDFORM.
Double click on STANDA02, it opens new screen(menu painter),there u can add menu bars, application tool bars etc.
Reward,if useful.
Thanks,
Chandu
Similar Messages
-
Want to use one parameter of first command into second parameter.
Hi, Experts,
Please help me out I am stuck in a crystal report. Actually i have written two commands in crystal report.
first one is as follows:-
Select * from oinv T0 inner join inv1 T1 on T0.DocEntry = T1.DocEntry Where T0.DocNum = {?Invoice No}
Second One is as follows:-
Select * from ibt1_Link Where BaseNum = {?Invoice No}
What i want is I am passing Parameter in both Command Which took Invoice no as an input, So i don't want to input ttwo parameter both for invoice no. can i use first parameter in my second command or not. If Yes then please tell me.How can i do the same.
Regards
HanesHave you tried joining your commands on the basenum = docnum fields? That should filter the second command?
-
I am using REUSE_ALV_GRID_DISPLAY function module
I want to use I_CALLBACK_PF_STATUS_SET' that field & show menu bar which I create but it's not showing that menu bar?
I am using following coding :
Please guide me..............
DOWNLOAD = 'MM'.
SET PF-STATUS 'MM'.
CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
EXPORTING
I_INTERFACE_CHECK = ' '
I_BYPASSING_BUFFER = ' '
I_BUFFER_ACTIVE = ' '
I_CALLBACK_PROGRAM = 'ZVR_INEX'
I_CALLBACK_PF_STATUS_SET = DOWNLOAD
I_CALLBACK_USER_COMMAND = 'HANDLE_USER_COMMAND'(005)
I_CALLBACK_TOP_OF_PAGE = ' '
I_CALLBACK_HTML_TOP_OF_PAGE = ' '
I_CALLBACK_HTML_END_OF_LIST = ' '
I_STRUCTURE_NAME =
I_BACKGROUND_ID = ' '
I_GRID_TITLE =
I_GRID_SETTINGS =
IS_LAYOUT =
IT_FIELDCAT = FIELDCAT_T
IT_EXCLUDING =
IT_SPECIAL_GROUPS =
IT_SORT =
IT_FILTER =
IS_SEL_HIDE =
I_DEFAULT = 'X'
I_SAVE = ' '
IS_VARIANT =
IT_EVENTS =
IT_EVENT_EXIT =
IS_PRINT =
IS_REPREP_ID =
I_SCREEN_START_COLUMN = 0
I_SCREEN_START_LINE = 0
I_SCREEN_END_COLUMN = 0
I_SCREEN_END_LINE = 0
I_HTML_HEIGHT_TOP = 0
I_HTML_HEIGHT_END = 0
IT_ALV_GRAPHICS =
IT_HYPERLINK =
IT_ADD_FIELDCAT =
IT_EXCEPT_QINFO =
IR_SALV_FULLSCREEN_ADAPTER =
IMPORTING
E_EXIT_CAUSED_BY_CALLER =
ES_EXIT_CAUSED_BY_USER =
TABLES
T_OUTTAB = I_VBPA
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.HI,
see this example.
REPORT ZBHALV_LIST1.
TABLES:MARA.
SELECT-OPTIONS: MATNR FOR MARA-MATNR.
DATA:BEGIN OF ITAB OCCURS 0,
MATNR LIKE MARA-MATNR,
ERSDA LIKE MARA-ERSDA,
MTART LIKE MARA-MTART,
MBRSH LIKE MARA-MBRSH,
END OF ITAB.
SELECT * FROM MARA INTO CORRESPONDING FIELDS OF TABLE ITAB WHERE MATNR
IN MATNR.
TYPE-POOLS SLIS.
DATA:FCAT TYPE slis_t_fieldcat_alv.
DATA:LAYOUT TYPE slis_layout_alv.
DATA:EVE TYPE slis_t_event WITH HEADER LINE.
DATA:HEAD TYPE slis_t_listheader WITH HEADER LINE.
DATA:SORT TYPE slis_t_sortinfo_alv WITH HEADER LINE.
SORT-UP = 'X'.
SORT-SPOS = 1.
SORT-FIELDNAME = 'ERSDA'.
SORT-tabname = 'MARA'.
APPEND SORT.
SORT-SPOS = 2.
SORT-FIELDNAME = 'MTART'.
SORT-tabname = 'MARA'.
APPEND SORT.
EVE-NAME = 'TOP_OF_PAGE'.
EVE-FORM = 'TOPOFPAGE'.
APPEND EVE.
EVE-NAME = 'TOP_OF_LIST'.
EVE-FORM = 'TOPOFLIST'.
APPEND EVE.
EVE-NAME = 'END_OF_LIST'.
EVE-FORM = 'ENDOFLIST'.
APPEND EVE.
LAYOUT-ZEBRA = 'X'.
LAYOUT-no_hline = 'X'.
LAYOUT-NO_VLINE = 'X'.
LAYOUT-window_titlebar = 'MATERIAL DETAILS'.
CALL FUNCTION 'REUSE_ALV_FIELDCATALOG_MERGE'
EXPORTING
I_PROGRAM_NAME = SY-REPID
I_INTERNAL_TABNAME = 'ITAB'
I_STRUCTURE_NAME =
I_CLIENT_NEVER_DISPLAY = 'X'
I_INCLNAME = SY-REPID
I_BYPASSING_BUFFER =
I_BUFFER_ACTIVE =
CHANGING
CT_FIELDCAT = FCAT
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.
CALL FUNCTION 'REUSE_ALV_LIST_DISPLAY'
EXPORTING
I_INTERFACE_CHECK = ' '
I_BYPASSING_BUFFER =
I_BUFFER_ACTIVE = ' '
I_CALLBACK_PROGRAM = SY-REPID
<b> I_CALLBACK_PF_STATUS_SET = 'STATUS'</b>
I_CALLBACK_USER_COMMAND = 'UCOMM'
I_STRUCTURE_NAME =
IS_LAYOUT = LAYOUT
IT_FIELDCAT = FCAT
IT_EXCLUDING =
IT_SPECIAL_GROUPS =
IT_SORT = SORT[]
IT_FILTER =
IS_SEL_HIDE =
I_DEFAULT = 'X'
I_SAVE = ' '
IS_VARIANT =
IT_EVENTS = EVE[]
IT_EVENT_EXIT =
IS_PRINT =
IS_REPREP_ID =
I_SCREEN_START_COLUMN = 5
I_SCREEN_START_LINE = 5
I_SCREEN_END_COLUMN = 120
I_SCREEN_END_LINE = 25
IMPORTING
E_EXIT_CAUSED_BY_CALLER =
ES_EXIT_CAUSED_BY_USER =
TABLES
T_OUTTAB = ITAB
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.
FORM TOPOFPAGE.
REFRESH HEAD.
HEAD-TYP = 'H'.
HEAD-INFO = 'MATERIALS'.
APPEND HEAD.
CALL FUNCTION 'REUSE_ALV_COMMENTARY_WRITE'
EXPORTING
IT_LIST_COMMENTARY = HEAD[]
I_LOGO =
I_END_OF_LIST_GRID =
ENDFORM.
FORM TOPOFLIST.
REFRESH HEAD.
HEAD-TYP = 'H'.
HEAD-INFO = 'MATERIALS-LISTTOP'.
APPEND HEAD.
CALL FUNCTION 'REUSE_ALV_COMMENTARY_WRITE'
EXPORTING
IT_LIST_COMMENTARY = HEAD[]
I_LOGO =
I_END_OF_LIST_GRID =
ENDFORM.
FORM ENDOFLIST.
REFRESH HEAD.
HEAD-TYP = 'H'.
HEAD-INFO = 'MATERIALS-LISTEND'.
APPEND HEAD.
CALL FUNCTION 'REUSE_ALV_COMMENTARY_WRITE'
EXPORTING
IT_LIST_COMMENTARY = HEAD[]
I_LOGO =
I_END_OF_LIST_GRID =
ENDFORM.
<b>FORM STATUS USING MYMENU.
*here MYMENU is the excluding buttons list
SET PF-STATUS 'MENU' excluding MYMENU.
ENDFORM.</b>
FORM UCOMM USING CODE STEXT.
CASE CODE.
WHEN 'ABC'.
WRITE:/ 'YOU HAVE CLICKED ON ABC'.
WHEN 'XYZ'.
WRITE:/ 'YOU HAVE CLICKED ON XYZ'.
ENDCASE.
ENDFORM.
rgds,
bharat. -
How to use lexical parameter in report
i want to use lexical parameter in report and pass parameter from form how it is possible in detail
A.RHi,
typically you fill your lexical paramter in the after-paramform-trigger out of the values of your bind-parameters (giving end users directly control over lexical parameters might not be a good idea). Inside PL/SQL a lexical parameter is referenced like bind parameters with ":". In the query it's referenced via "&" and represents a part of the query.
A simple example.
- p_deptno as bind parameter
- p_where as lexical paramter
- end user choose value for p_deptno (10,20,... or nothing)
- Trigger: if :p_deptno is not null then
:p_where := 'WHERE deptno = :p_deptno'
else
:p_where := null;
end if;
- Query select ... from emp &p_where
Regards
Rainer -
How to use import parameter to be instead of SQL where sub-sentence ?
I wrote a RFC to read data from SAP table. To fetch data flexibility, I want to use import parameter xx instead of where sub-sentence in SQL sentence.
For example, "SELECT * FROM T WHERE XXX", and "XXX" is a importing parameter.
How can I use it.
Thanks a lot.
Frank.FUNCTION ZRFC_04.
*"*"Local Interface:
*" IMPORTING
*" VALUE(TARGETTABLE) LIKE MAKT-MAKTX
*" VALUE(TWHERE) LIKE MAKT-MAKTX
*" EXPORTING
*" VALUE(ZRETURN) LIKE MAKT-MAKTX
*" TABLES
*" TMP_TEST1 STRUCTURE ZTEST1
DATA:
TRANSACTION_ID LIKE ARFCTID,
V_VAILD(1) TYPE C,
scond(80) TYPE c.
V_VAILD = 'X'.
GET PARAMETER twhere fields scond.
The error " 'LATE FIELDS' expected, not 'TWHERE FIELDS' " generated. -
How to use a parameter field value as a substring in a "like" statement?
Hi all,
I'm trying to use a parameter field in a Record selection formula where the parameter field value would be a substring of the data stored in the field.
My parameter field (SlctResearcher) is constructed as follows:
Type: string
List of Values: static
Value Field: (Reports) RptAuthors
(in Value Options) Allow custom values?: True
{Reports.PubDate} in DateTime (2009, 04, 01, 00, 00, 00) to DateTime (2010, 03, 31, 23, 59, 59) and
{Reports.RptAuthors} like "*{?SlctResearcher}*"
When I hit F5 to generate the data, I get no results (and the parameter prompt field does not even come up...)
If I modify the formula to put a hard-coded string, like
"*Jones*"
after the 'like', I get results (all the reports where "Jones" is a substring in the RptAuthors string.) If I modify the formula to just use the parameter field without the quotes/stars like:
{Reports.PubDate} in DateTime (2009, 04, 01, 00, 00, 00) to DateTime (2010, 03, 31, 23, 59, 59) and
{Reports.RptAuthors} like {?SlctResearcher}
I do get the parameter prompt field, but still no results even if I put in a valid substring value (since it is not searching for a substring anymore...)
How can I do this?
Thanks,
Will1st thing... Make a copy of your report before doing anything!!!
To use a SQL Command, you'll want to open the Database Expert and look at the Current Connections. Expand the data source and the 1st option you see is the Add Command option.
To find the SQL That CR is currently using, choose Database from the menu bar and select Show SQL Query...
You can copy this and paste it directly into the command window. (If you you can write your own SQL you don't need copy CR's, it's just an option.)
You'll also want to take not of any parameters that you have, you'll need to add them the the Parameter List of the command as well... be sure to spell them EXACTLY as they are in the design pane.
Anyway, once the SQL statement is in the Command window you'll be able to alter the WHERE clause to use the wild cards.
For future reference... What type of database are you reporting against???
Jason -
URL iView Problem - How to Use URL Parameter of Type 'User Information'
Hello URL iView experts
I am currently working on integration of backend-functionality with the help of an URL iView.
I want to use a parameter of type 'User Information'. In SAP Help Library it is said, that it is possible to set the value of a parameter according to a dynamic query on the users attributes. (Link SAP HELP)
It is also said, that one can retrieve the Logon ID of the users account.(Attribute Name: j_user -> Link SAP HELP Attributes )
I can choose the type 'User Information' but i don't know what to specify in the field 'Value'.
I have made a screenshot of the problem.->[Link to screenshot|http://img66.imageshack.us/img66/7782/urliviewproblemfrsdnthrel3.jpg]
But if i am calling the application this way, he doesn't retrieve the Logon-ID of the account, but he just uses the 'j_user' as value for the parameter.
Can you tell me, what i need to specify in the field value?
Best Regards
Marcus
Edited by: Marcus Böhm on Jun 2, 2008 1:22 PMHi Marcus,
> It is also said, that one can retrieve the Logon ID of the users account
This is not correct; on the help.sap.com-page concerning the URL-iView-Parameters, it is printed that "other attributes (general, account, group, role) are not supported". The j_user attribute is part of the account group, so - not supported.
For your needs, it may be a better choose to use the AppIntegrator, which offers such a possibility by using "<User.LogonUid>"; see http://help.sap.com/saphelp_nw70/helpdata/EN/36/5e3842134bad04e10000000a1550b0/frameset.htm and https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/e0cbc309-ff89-2a10-8bad-bcde4c152ecb
Hope it helps
Detlev -
How can i make calculation in two file using two parameter
how can i make calculation in two file using two parameter
Solved!
Go to Solution.i am having two differnt file, both file having no and time , i want to make programme that when, number and tiome is same in both file give that index onle in , i am going to attached the file
Attachments:
iisc11-jan2010extract.txt 1253 KB
sp3.xlsx 12 KB -
Using paramform parameter !!!
Dear all,
I would to know, where can i specify the paramform parameter in the sample code delivers with the package:"Oracle Forms Services - Using Run_Report_Object to call Reports with a Parameter Form".
It's a set of document and sample codes which gives a solution encountred when we try call Report from Form using a parameter form.
Thank u for your help.I just implemented the white paper's RUN_REPORT_OBJECT_PROC procedure yesterday. (We're doing a simple pilot 6i Client Server form/report conversion to Forms10g and 10gAS.)
To be honest, after reading the white paper I wasn't quite sure what this procedure was going to do. But after implementing it, here's what we see:
If we pass a PARAMFORM=YES to the procedure using the report_otherparam, an HTML representation of the report's parameter form will be generated for the user.
In our case, the original report parameter form had a populated list box of payroll periods. The new HTML parameter form even used the boilerplate text from our original parameter form and had a populated list box of the payroll periods. So it basically duplicated the original client/server parameter form into HTML with no work needed from us. I was impressed.
Our only problem at this point is that when calling the report from our webform, we're being asked for a single signon logon. We don't want to use that yet, but can't find where to turn it off.
Dave -
HOW TO USE LEXICAL PARAMETER IN FORMS9I
CAN I USE LEXICAL PARAMETER IN FORMS9I I WANT TO CREATE QUERY LIKE THIS
SELECT * FROM &TABLE_NAME
WHERE &CHOICE
WHERE &TABLE_NAME = EMP, AND &CHOICE EMPNO=12344
PLS HELPNo, you can do it in sqlplus or reports but not in forms.
If this is a datablock query you need to use set_block_property.
If it is in a trigger you need to use execute immediate. -
How to use dynamic parameter when a report is created using Stored Procedures
Hi all,
any one have the idea of how to use dynamic parameter in crystal report XI R2
when report is created using Stored Procedure.
Regards
shashi kant chauhanHi
You can create an SQL command in Database Expert > Expand your datasource > Add command
Then enter the SQL query that will create the list of values to supply to the user
eg select field1,field2 from table
Then edit the parameter of the report. These will be the SP parameters adn can be seen in field explorer.
Change the parameter type to Dynamic
Under the word Value click on Click here to add item
Scroll down to your Command and select one of the values that you want to appear in the list
e.g field1
Then click on the Parameters field - this is essential to create the param
You can edit other options as required
That should do it for you.
I must say that i use CR 2008 connected to Oracle 10g SP, but i reckon this will work for SQL DB and CR XI as well
Best of luck -
Hi all
An RFC FM can using string parameter? why i using string pass value ,the destination reciev the value is wrong?
thanks
BR
ChrisAre you using any std func.. just wanted to chek that there is no internal conversion routine....
Enjoy SAP.
Pankaj Singh -
Please explain how to use the parameter Id and Search Help in Data Element Creation.
hi,
explain how to use the parameter Id ?
It is used to retain the value across screens/sessions.for creating parameter ID goto sm30 give the table TPARA->set/get parameter id
use with example:mainly used for traversing from report to transactions.
REPORT ZSR_ALV_INTERACTIVE.
TABLES : LFA1,EKKO,EKPO.
SELECT-OPTIONS : VENDOR FOR LFA1-LIFNR.
DATA : BEGIN OF ITAB OCCURS 0,
LIFNR LIKE LFA1-LIFNR,
NAME1 LIKE LFA1-NAME1,
END OF ITAB.
DATA : BEGIN OF JTAB OCCURS 0,
EBELN LIKE EKKO-EBELN,
AEDAT LIKE EKKO-AEDAT,
END OF JTAB.
DATA : BEGIN OF KTAB OCCURS 0,
EBELP LIKE EKPO-EBELP,
MATNR LIKE EKPO-MATNR,
END OF KTAB.
TYPE-POOLS : SLIS.
DATA : REPID LIKE SY-REPID.
DATA :LFA1_B TYPE SLIS_T_FIELDCAT_ALV,
LFA1_W TYPE SLIS_FIELDCAT_ALV,
EKKO_B TYPE SLIS_T_FIELDCAT_ALV,
EKKO_W TYPE SLIS_FIELDCAT_ALV,
EKPO_B TYPE SLIS_T_FIELDCAT_ALV,
EKPO_W TYPE SLIS_FIELDCAT_ALV,
EVENTS_B TYPE SLIS_T_EVENT,
EVENTS_W TYPE SLIS_ALV_EVENT.
PERFORM GET_VAL.
REPID = SY-REPID.
SELECT LIFNR NAME1 FROM LFA1 INTO TABLE ITAB WHERE LIFNR IN VENDOR.
*perform val USING USER_COMMAND sel.
CALL FUNCTION 'REUSE_ALV_LIST_DISPLAY'
EXPORTING
I_CALLBACK_PROGRAM = REPID
IT_FIELDCAT = LFA1_B
IT_EVENTS = EVENTS_B
TABLES
T_OUTTAB = ITAB.
FORM GET_VAL.
LFA1_W-FIELDNAME = 'LIFNR'.
LFA1_W-REF_TABNAME = 'LFA1'.
LFA1_W-REF_FIELDNAME = 'LIFNR'.
APPEND LFA1_W TO LFA1_B.
LFA1_W-FIELDNAME = 'NAME1'.
LFA1_W-REF_TABNAME = 'LFA1'.
LFA1_W-REF_FIELDNAME = 'NAME1'.
APPEND LFA1_W TO LFA1_B.
EKKO_W-FIELDNAME = 'EBELN'.
EKKO_W-REF_TABNAME = 'EKKO'.
EKKO_W-REF_FIELDNAME = 'EBELN'.
APPEND EKKO_W TO EKKO_B.
EKKO_W-FIELDNAME = 'AEDAT'.
EKKO_W-REF_TABNAME = 'EKKO'.
EKKO_W-REF_FIELDNAME = 'AEDAT'.
APPEND EKKO_W TO EKKO_B.
EKPO_W-FIELDNAME = 'EBELP'.
EKPO_W-REF_TABNAME = 'EKPO'.
EKPO_W-REF_FIELDNAME = 'EBELP'.
APPEND EKPO_W TO EKPO_B.
EKPO_W-FIELDNAME = 'MATNR'.
EKPO_W-REF_TABNAME = 'EKPO'.
EKPO_W-REF_FIELDNAME = 'MATNR'.
APPEND EKPO_W TO EKPO_B.
EVENTS_W-NAME = 'USER_COMMAND'.
EVENTS_W-FORM = 'VAL'.
APPEND EVENTS_W TO EVENTS_B.
ENDFORM. "GET_VAL
FORM VAL USING USER_COMMAND LIKE SY-UCOMM SEL TYPE SLIS_SELFIELD.
DATA : VEN(10) TYPE N,
PO(10) TYPE N.
DATA : MAT(10) TYPE C.
IF SEL-FIELDNAME = 'LIFNR'.
VEN = SEL-VALUE.
SELECT EBELN AEDAT FROM EKKO INTO TABLE JTAB WHERE LIFNR = VEN.
CALL FUNCTION 'REUSE_ALV_LIST_DISPLAY'
EXPORTING
I_CALLBACK_PROGRAM = REPID
I_STRUCTURE_NAME = EKKO_B
IT_FIELDCAT = EKKO_B
IT_EVENTS = EVENTS_B
TABLES
T_OUTTAB = JTAB.
ENDIF.
IF SEL-FIELDNAME = 'EBELN'.
PO = SEL-VALUE.
SELECT EBELP MATNR FROM EKPO INTO TABLE KTAB WHERE EBELN = PO.
CALL FUNCTION 'REUSE_ALV_POPUP_TO_SELECT'
EXPORTING
I_TITLE = 'ITEM DETAILS'
I_TABNAME = 'EKPO'
IT_FIELDCAT = EKPO_B
I_CALLBACK_PROGRAM = REPID
IMPORTING
ES_SELFIELD = SEL
TABLES
T_OUTTAB = KTAB.
ENDIF.
logic to select a record
IF SEL-FIELDNAME = 'MATNR'.
<b>MAT = SEL-VALUE.
SET PARAMETER ID 'MAT' FIELD MAT.</b> CALL TRANSACTION 'MM02' AND SKIP FIRST SCREEN.
ENDIF.
ENDFORM. "VAL
Search Help :
http://help.sap.com/saphelp_nw04/helpdata/en/cf/21ee38446011d189700000e8322d00/content.htm
http://help.sap.com/saphelp_nw04/helpdata/en/cf/21ee45446011d189700000e8322d00/content.htm
pls go through this for search help creation
http://help.sap.com/saphelp_nw2004s/helpdata/en/41/f6b237fec48c67e10000009b38f8cf/content.htm -
Disable SSRS parameter using another parameter value
Hello, I'm developing using SQL Server 2008 R2 standard edition & I would like to disable 2 parameters (parRestraint and par RestrantPosition) by using another parameter, "Restraint Filters On Off".
When the user loads the report up, I want the On Off filter to be defaulted to off, and the former 2 params to be disabled, but the default value to be visible for them, which are NDX tuples.
parRestraint default value = [Incident].[Incident Restraint].[All] (from MDX dataset)
parRestraintPosition default value = [Incident].[Incident Restraint Position].[All] (from MDX dataset)
ANy advice appreciated !An additional pierce of information is that the data for the parameters comes from an Analysis Services cube (Restraint and Restraint Position are attributes of the Incident dimension).
I would like to be able to set a null value for default values of Restraint and Restraint Position parameters, but SSRS won't allow me to do this.
My code for Restraint default param value
=IIF(Parameters!IncidentYN.Value = -1,
"null","[Incident].[Incident
Restraint].&[UnAssigned]")
or
=IIF(Parameters!IncidentYN.Value = -1,
null,[Incident].[Incident
Restraint].&[UnAssigned])
Both example fail. I think that this could be achieved with a relational database as the data source for the parameters, but need someone to confirm this.
Thanks everyone.
Dave -
Using a parameter for a table name?
In SQL Server, can you use a parameter for a table name? I'm working with Visual C# and want to do something like this:
SELECT MAX(ItemID) FROM @TableName;
Can this be done?
(Basically, I have three separate methods within a class--one for each table I have; and each one will perform the above query but on different table names. I'd like to see if there is a way that I can have just one method that will allow me to specify
the table name.)As pointed out in other posts, you can. But a more relevant question is whether you should.
A table in a relational database is supposed to model a unique entity, and each column in the table is supposed to model a unique attribute. This is not always how it is, but it is from this model a relational database is designed.
From this angle, having a dynamic table name does not really make sense for application code. (Administrative actions is a different story.) Think of it this way: have you ever wanted to make the class name dynamic in C#?
Admittedly, it is different in .NET, because everything inherits from System.Object, but in a relational database there is no inheritence.
Anyway, if you are using stored procedures, you should have one stored procedure per table. Physically, in the plan cache, there will be one query plan per table, no matter how you do it.
If you are submitting SQL statements from your application, it is a different matter. In this case, I find it difficult to object if you have a class that performs generic actions against tables. Then you build the SQL string in the client code.
However, no matter how you do it, you need to be careful to avoid SQL injection. We had the example:
DECLARE @TableName nvarchar(50),@sqlCommand nvarchar(max)
SET @TableName = ' ItemInformation'
SET @sqlCommand = 'SELECT MAX(ItemID) FROM ' + @TableName
EXEC (@sqlCommand)
But what if we have:
SET @TableName = ' sys.objects; SHUTDOWN WITH NOWAIT; --'
As long as we do it in T-SQL, we can (and we should do!) this to prevent SQL injection:
SET @sqlCommand = 'SELECT MAX(ItemID) FROM ' + quotename(@TableName)
If you build your SQL strings in C#, you will need to employ other checks. There is only an issue if the user can inject data somewhere, but your generic class will not have knowledge of this, and must assume the worst.
Erland Sommarskog, SQL Server MVP, [email protected]
Maybe you are looking for
-
Can't drag files or folders from DVD-R in Finder
When I try to drag a folder from a DVD-R to my MacBook Pro, i get the "can't do this" icon, a circle with a line thru it. i can't drag any of the files inside the folder to my mac either. (It's a pro tools project folder.) haven't run into this befor
-
ISE 1.2 with MDM intergration
Hi, I'm trying to intergrate with Zen MDM. has anyone seen this issue ? there is no mdm policy to configure in ISE, as I know, but it keeps me to redirect to that page. I already added MDM server in administration -> network resour
-
Create an Apple ID without having to input a payment method
Scenario: This is for a school owned student used iPad. Problem: Can't download apps until I assign a payment method to my account Description: I've just created an Apple ID through the web browser (IE) on a Windows machine. Go to download an App on
-
Cleaning up child class on parent wire
I have a child class running on a parent wire. The parent class has a reference, and the child class has some additional references. I want to clean these up during shutdown. But, because it is a parent wire, I cannot call my child class's "destroy"
-
WTK 2.5.1 Network Monitor a bit short
I'm trying to run a continuous test on an application that communicates a lot of data over the mobile network, and I found that the network monitor log only handles around 900 entries until AWT crashes. Based on the error there seems to be a fixed-si