Select into fields
Hi all!!.
I want to put just a record in three fields, is it necesary to put them in a structure?
TABLES PB4000.
DATA: APSTA LIKE PB4000-APSTA,
STREA LIKE PB4000-STREA,
MASSN LIKE PB4000-MASSN.
SELECT APSTA STREA MASSN
FROM PB4000
INTO APSTA, STREA, MASSN.
WHERE PERNR = '99999803'
AND ENDDA = '99991231'.
ENDSELECT.
Comma without preceding colon (after SELECT ?).
Adrian Samper ,
SELECT single APSTA STREA MASSN
FROM PB4000
INTO (APSTA, STREA, MASSN)
WHERE PERNR = '99999803'
AND ENDDA = '99991231'.
ENDSELECT.
This will work and you have to specify INTO clause, i mean it is necessary to put them into structure or Internal table or variables.
Regards,
Amey
Similar Messages
-
I want to select data into a changeable struct so i used field-symbols but in select statement i got an error saying that "With an Open SQL select, the output area is too small"..i use ANY type in declaration of field-symbols.
What can i do correct this mistake?
SELECT * INTO TABLE FIELDS FROM T682Z WHERE KOZGF = 'ZPPT' AND KOLNR = T682I-KOLNR
ORDER BY ZAEHK.
CONCATENATE 'CNCCRMPR' T682I-KOTABNR INTO TN.
FIELD-SYMBOLS <FS> type any.
SELECT * FROM (TN) INTO <FS>
WHERE TIMESTAMP_TO >= time_stamp AND TIMESTAMP_FROM <= time_stamp.
ENDSELECT.Hi..
You can check this code to know how to use Field symbols in SELECt.
Try it....
DATA : REF_TAB TYPE REF TO DATA.
FIELD-SYMBOLS: <FTAB> TYPE TABLE.
DATA: L_TABNAME TYPE DD02L-TABNAME VALUE 'EKPO'.
CREATE DATA REF_TAB TYPE TABLE OF (L_TABNAME).
ASSIGN REF_TAB->* TO <FTAB>.
SELECT * FROM (L_TABNAME) INTO TABLE <FTAB>.
DESCRIBE TABLE <FTAB>.
WRITE:/ SY-TFILL.
REWARD IF HELPFUL. -
Reading from select-options field into the internal table
Hi,
I have to read the low and high ranges from the select-options fields into a field in the internal table in order to update the same field in line item table. since the user may change the screen fields, i need to pass the values directly from the screen and store it in a variable in the internal table. Is there a way to pass both ranges, low and high to one variable which holds the entire range?
Thanks,
SruthyHi,
In the Selection screen you can directly read the field(Select-option)value using read statement as follows:
READ TABLE <SELECT-OPTIONS field name> [using index] INTO <work area>.
After reading you can directly access all the values as follows and can store them in the variables:
var1 = <work area>-LOW
var2 = <work area>-HIGH
var3 = <work area>-SIGN
var4 = <work area>-OPTION
as per your requirement.
I think this will help you.
<b>Kindly reward if helpful.</b>
Regards,
Shakuntala. -
Not able populate correct data into fields in alv report
hi experts,
question: from delivery document number(likp-vbeln) go to delivery items to get lips-matnr,lips-lgort
TYPE-POOLS:SLIS.
TABLES: MARC,LIPS,LIKP,VBAK,VBAP,VBRP.
SELECT-OPTIONS:S_VKORG FOR LIKP-VKORG,
S_VBELN FOR LIKP-VBELN,
S_MATGR FOR MARC-MATGR,
S_AUART FOR VBAK-AUART.
DATA: BEGIN OF ITAB OCCURS 0 ,
MATGR LIKE MARC-MATGR,
MATNR LIKE LIPS-MATNR,
LGORT LIKE LIPS-LGORT,
WADAT_IST LIKE LIKP-WADAT_IST,
AUART LIKE VBAK-AUART,
WAVWR LIKE VBRP-WAVWR,
KWMENG LIKE VBAP-KWMENG,
VBELN LIKE LIKP-VBELN,
VBELN LIKE VBAK-VBELN,
<GORT TYPE LIPS-LGORT,
END OF ITAB.
DATA: BEGIN OF JTAB OCCURS 0,
VBELN LIKE VBAK-VBELN,
END OF JTAB.
DATA: I_FIELDCAT TYPE SLIS_T_FIELDCAT_ALV WITH HEADER LINE,
I_EVENTCAT TYPE SLIS_T_EVENT WITH HEADER LINE.
START-OF-SELECTION.
SELECT AMATNR ALGORT INTO TABLE ITAB FROM LIPS AS
A INNER JOIN
LIKP AS B ON BVBELN EQ AVBELN WHERE BVBELN IN S_VBELN AND BVKORG
IN
S_VKORG.
ENDSELECT.
*I_FIELDCAT-COL_POS = 1.
*I_FIELDCAT-FIELDNAME = 'VBELN'.
*I_FIELDCAT-TABNAME = 'ITAB'.
*APPEND I_FIELDCAT TO I_FIELDCAT.
*CLEAR I_FIELDCAT.
I_FIELDCAT-COL_POS = 1.
I_FIELDCAT-FIELDNAME = 'MATNR'.
*I_FIELDCAT-TABNAME = 'ITAB'.
I_FIELDCAT-REF_TABNAME = 'MATNR'.
I_FIELDCAT-REF_TABNAME = 'LIPS'.
APPEND I_FIELDCAT .
*CLEAR I_FIELDCAT.
I_FIELDCAT-COL_POS = 2.
I_FIELDCAT-FIELDNAME = 'LGORT'.
*I_FIELDCAT-TABNAME = 'ITAB'.
I_FIELDCAT-REF_TABNAME = 'LIPS'.
APPEND I_FIELDCAT .
*CLEAR I_FIELDCAT.
CALL FUNCTION 'REUSE_ALV_LIST_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 = ' '
I_STRUCTURE_NAME =
IS_LAYOUT =
IT_FIELDCAT = I_FIELDCAT[]
IT_EXCLUDING =
IT_SPECIAL_GROUPS =
IT_SORT =
IT_FILTER =
IS_SEL_HIDE =
I_DEFAULT = 'X'
I_SAVE = ' '
IS_VARIANT =
IT_EVENTS = I_EVENTCAT[]
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
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.
i am unable to populate correct data into fields i am getting matnr values as all 1's
and lgort as empty
can anyone help me out
thanks.HI there
This is what i found on the Forum
"You can use FM RS_VARIANT_CONTENTS to display ONE variant associated to a report
If you want to see the information of ALL VARIANTS associated to a report I think the only way is checking table VARID to get all the variants associated to the report and then do a loop and call RS_VARIANT_CONTENTS for each variant."
Regards
Tatenda -
F4 Help for the selection screen field
Hi Gurus,
I have to display F4 help for a selection screen field. i am using following code:
CALL FUNCTION 'F4IF_INT_TABLE_VALUE_REQUEST'
EXPORTING
retfield = 'CODE'
dynpprog = lw_repid
dynpnr = sy-dynnr
VALUE_ORG = 'S'
TABLES
value_tab = gi_text
field_tab = li_fields_tab
return_tab = pi_return_tab
EXCEPTIONS
parameter_error = 1
no_values_found = 2
OTHERS = 3.
My internal table gi_emp has two fields CODE & TEXT. When i select 1 particular value, it returns the CODE value in the pi_return_tab table.
But my requirement is i have to capture the corresponding TEXT value for the Returned CODE. Ex: following is the F4 help being displayed: -
001 test
001 test1
but is i select code 001(First Value), i also need to capture it's corresponding Text value. In return table pi_return_tab i have only Code value.
Please help me out.
Note: Based on return code i can't search into the internal table gi_code, because as shown in the example, code has multiple text.Sachin,
I think this is what you need. The following code will return the key and the text (OR any other columns), if both columns are in the selection screen the selected values (both columns) will also be passed to the corresponding parameters. If you only need the text to be in the return table and not passed to the selection screen then set the parameter for text with NO-DISPLAY option.
REPORT zktest01 .
DATA :
BEGIN OF value_tab OCCURS 0,
field LIKE e070-trkorr,
text LIKE e07t-as4text,
END OF value_tab.
DATA: t_fldtab LIKE dfies OCCURS 0 WITH HEADER LINE,
t_rettab LIKE ddshretval OCCURS 0 WITH HEADER LINE,
t_dynmap LIKE dselc OCCURS 0 WITH HEADER LINE.
PARAMETERS : p_field LIKE value_tab-field,
p_text LIKE value_tab-text. "NO-DISPLAY.
INITIALIZATION.
t_fldtab-tabname = 'VALUE_TAB'.
t_fldtab-fieldname = 'FIELD'.
t_fldtab-langu = 'E'.
t_fldtab-position = 1.
t_fldtab-offset = 0.
t_fldtab-fieldtext = 'Key'.
t_fldtab-reptext = 'Key'.
t_fldtab-leng = 20.
t_fldtab-intlen = 20.
t_fldtab-outputlen = 20.
t_fldtab-datatype = 'CHAR'.
t_fldtab-inttype = 'C'.
t_fldtab-headlen = 20.
t_fldtab-keyflag = 'X'.
t_fldtab-lowercase = ' '.
APPEND t_fldtab.
t_fldtab-tabname = 'VALUE_TAB'.
t_fldtab-fieldname = 'TEXT'.
t_fldtab-position = 2.
t_fldtab-offset = 20.
t_fldtab-fieldtext = 'Text'.
t_fldtab-reptext = 'Text'.
t_fldtab-leng = 60.
t_fldtab-intlen = 60.
t_fldtab-outputlen = 60.
t_fldtab-headlen = 60.
t_fldtab-keyflag = ' '.
t_fldtab-lowercase = ' '.
APPEND t_fldtab.
value_tab-field = '101'.
value_tab-text = 'dddd'.
APPEND value_tab.
value_tab-field = '202'.
value_tab-text = 'aaaa'.
APPEND value_tab.
t_dynmap-fldname = 'FIELD'.
t_dynmap-dyfldname = 'P_FIELD'.
APPEND t_dynmap.
t_dynmap-fldname = 'TEXT'.
t_dynmap-dyfldname = 'P_TEXT'.
APPEND t_dynmap.
AT SELECTION-SCREEN ON VALUE-REQUEST FOR p_field.
CALL FUNCTION 'F4IF_INT_TABLE_VALUE_REQUEST'
EXPORTING
retfield = 'FIELD'
dynpprog = 'ZKTEST01'
dynpnr = '1000'
dynprofield = 'P_FIELD'
value_org = 'S'
TABLES
field_tab = t_fldtab
value_tab = value_tab
return_tab = t_rettab
dynpfld_mapping = t_dynmap
EXCEPTIONS
parameter_error = 1
no_values_found = 2
OTHERS = 3.
IF sy-subrc EQ 0.
ENDIF.
START-OF-SELECTION.
Jeffrey Satriadi -
Dynamic column name with SELECT INTO
I am trying to build a function that derives a pay amount from a set of business rules. There are about 40 columns that hold various pay amounts and their column names are variations of 4 indicators (day shift, vs night shift, etc.) that I have to dynamically look up, ie here is the ID number and a timecard, now figure out which of the 40 fields to look up to get the pay amount.
I can determine from the timecard and employee ID which field to look at, but I'm getting hung up with the syntax needed to construct and execute the statement inside the PL/SQL block. I need to RETURN the pay I extract using the function, and I can create the correct SQL statement, but the EXECUTE IMMEDIATE won't accept the SELECT INTO syntax.
Can someone please suggest a solution? Here is the function:
create or replace FUNCTION FN_GET_PAYRATE(tc in NUMBER, e in NUMBER, pc in VARCHAR2)
RETURN NUMBER
IS
e_id NUMBER;
tc_id NUMBER;
pl_cd VARCHAR2(7);
shft VARCHAR2(2);
lvl VARCHAR2(2);
typ VARCHAR2(2);
e_typ VARCHAR2(4);
proj NUMBER;
hrly VARCHAR2(4);
payrt NUMBER;
var_col VARCHAR2(10);
sql_select VARCHAR2(200);
sql_from VARCHAR2(200);
sql_where VARCHAR2(200);
sql_and1 VARCHAR2(200);
sql_and2 VARCHAR2(200);
sql_and3 VARCHAR2(200);
sql_orderby VARCHAR2(200);
var_sql VARCHAR2(2000);
BEGIN
e_id := e;
tc_id := tc;
pl_cd := pc;
SELECT NVL(SHIFT,'D') INTO shft
FROM TS_TIMECARD_MAIN
WHERE TIMECARD_ID = tc_id;
--DBMS_OUTPUT.PUT_LINE('SHIFT= ' || shft);
SELECT NVL(PAY_LVL, 1), NVL(PAY_TYPE, 'B'), NVL(RTRIM(EMP_TYPE), 'LHD'), NVL(PROJECT, 001)
INTO lvl, typ, e_typ, proj
FROM TS_EMPLOYEES
WHERE EMP_ID = e_id;
--DBMS_OUTPUT.PUT_LINE('Level= ' || lvl);
--DBMS_OUTPUT.PUT_LINE('PAY_TYPE= ' || typ);
--DBMS_OUTPUT.PUT_LINE('EMP_TYPE= ' || e_typ);
--DBMS_OUTPUT.PUT_LINE('PROJECT= ' || proj);
IF e_typ <> 'LHD' THEN
hrly := 'H';
ELSE
hrly := '';
END IF;
IF proj <> 001 THEN
var_col := shft || lvl || typ || hrly;
--DBMS_OUTPUT.PUT_LINE('RATE COLUMN= ' || var_col);
sql_select := 'SELECT NVL(' || var_col || ', .01) INTO payrt';
sql_from := ' FROM TS_PAYRATES';
sql_where := ' WHERE PROJECT_ID = ' || proj;
sql_and1 := ' AND ACTIVE = 1';
sql_and2 := ' AND JOB_TYPE = ' || CHR(39) || e_typ || CHR(39);
sql_and3 := ' AND PILE_ID = ' || CHR(39) || pl_cd || CHR(39);
var_sql := sql_select || sql_from || sql_where || sql_and1 || sql_and2 || sql_and3 || sql_orderby;
DBMS_OUTPUT.PUT_LINE('SQL: ' || var_sql);
EXECUTE IMMEDIATE var_sql;
DBMS_OUTPUT.PUT_LINE('RATE= ' || payrt);
RETURN payrt;
ELSE
DBMS_OUTPUT.PUT_LINE('ERROR');
RETURN 1;
END IF;
END;
I have alternately tried this:
SELECT NVL(var_col,.01) into payrt
FROM TS_PAYRATES
WHERE PROJECT_ID = proj AND ACTIVE = 1
AND JOB_TYPE = CHR(39) || e_typ || CHR(39)
AND PILE_ID = CHR(39) || pl_cd || CHR(39);
as a substitute for the EXECUTE IMMEDIATE block, but I can't seem to use a dynamic substitution for the column name.
Any help would be greatly appreciated.That's the most difficult part - the error messages seem to indicate a problem with the SQL statement in its execution context, because I can take the SQL string by itself and it executes perfectly.
Here are three variations:
SELECT INTO
select fn_get_payrate(21555, 30162, 15) from dual
ERROR at line 1:
ORA-00905: missing keyword
ORA-06512: at "PEOPLENETIF.FN_GET_PAYRATE", line 60
SQL: SELECT NVL(N4P , .01) INTO payrt FROM TS_PAYRATES WHERE PROJECT_ID = 701 AND ACTIVE = 1 AND JOB_TYPE = 'LHD' AND PILE_ID = '15'
Without SELECT INTO (returns NULL)
SQL> select fn_get_payrate(21555, 30162, 15) from dual;
FN_GET_PAYRATE(21555,30162,15)
SQL: SELECT NVL(N4P , .01) FROM TS_PAYRATES WHERE PROJECT_ID = 701 AND ACTIVE = 1 AND JOB_TYPE = 'LHD' AND PILE_ID = '15'
RATE=
EXECUTE IMMEDIATE USING
SQL> select fn_get_payrate(21555, 30162, 15) from dual;
select fn_get_payrate(21555, 30162, 15) from dual
ERROR at line 1:
ORA-01006: bind variable does not exist
ORA-06512: at "PEOPLENETIF.FN_GET_PAYRATE", line 61
SQL: SELECT NVL(N4P , .01) FROM TS_PAYRATES WHERE PROJECT_ID = 701 AND ACTIVE = 1 AND JOB_TYPE = 'LHD' AND PILE_ID = '15' -
Validating a selection-screen field
Hi all,
I am Anil.can any body explains me how to validate a selection-screen field for the following scenario?
I have customer nos ranging from 100-1000.among them i dont have any sales orders for the customers who are in between 150-250.I have sales order(VBELN) as select-options and Plant(WERKS) as Parameter on the selection-screen.I want to validate these fields without hardcaode.How can i do that?Please send me the complete code.
I am not getting how to validate a field which is declared as parameter?
regards and thanks in advance.
Anil.Make sure that u are validating against the header table.
say eg if u wnat t validate matnr in marc, then do as below.
SELECT-OPTIONS: s_matnr FOR marc-matnr. "Material No
AT SELECTION-SCREEN.
*Validate material no details
PERFORM validate_matno.
FORM validate_matno.
DATA: v_matnr LIEK mara-matnr.
SELECT SINGLE matnr INTO v_matnr
FROM <b>mara</b>
WHERE matnr IN s_matnr.
IF sy-subrc NE 0.
MESSAGE i128.
LEAVE LIST-PROCESSING.
ENDIF.
ENDFORM.
Dont select from marc.
Hope this is clear. -
F4 help FOR A SELECT OPTION FIELD
Hi,
Can anyone tell how to provide F4help for a select-option field?
Regards,
HemaHello,
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.
Thanks
Deepu.K -
Can we create serach help for a selection screen field
Can we create serach help for a selection screen field with out creating searchhelp object.
I mean is it possible to create serchelp in the program itself with some specific values i want to give.
E.g say we can define any internal table and fill it with values and using that into selection screen fields
Regards
MaveAT SELECTION-SCREEN ON VALUE-REQUEST FOR paymeth.
PERFORM PAYMENT_HELP.
FORM PAYMENT_HELP.
DATA: begin of DESCR_TAB occurs 0,
DESCR LIKE BKPF-BKTXT,
END OF DESCR_TAB.
DATA: gd_repid like sy-repid.
gd_repid = sy-repid.
DESCR_TAB-DESCR = 'aaaaa'.
append DESCR_TAB.
DESCR_TAB-DESCR = 'bbbbb'.
append DESCR_TAB.
DESCR_TAB-DESCR = 'ccccc'.
append DESCR_TAB.
CALL FUNCTION 'F4IF_INT_TABLE_VALUE_REQUEST'
EXPORTING
retfield = 'DESCR'
DYNPPROG = gd_repid
DYNPNR = '1000'
DYNPROFIELD = 'paymeth'
VALUE_ORG = 'S'
DISPLAY = ' '
TABLES
value_tab = DESCR_TAB.
endform.
Svetlin -
Hi ,i want provide a input help for a Selection input field
Hi Experts,
I want to provide a input help for field in selection-screen ,
this field is non primary key Custom Table(Z) selection input field .
how we can get ,f4 help for this field.
how to get f4 help Suppose field Link s_mtart-low,s_mtart-high,
What are the function moduled available for this >
Thanks in Advance.
Regards,
Hitu.Hi,
refer to below code.
*AT SELECTION-SCREEN ON VALUE-REQUEST FOR s_usnam-low.
**//To provide F4 help to S_USNAM-LOW
PERFORM f_f4help_usnam USING 'S_USNAM-LOW'.
*AT SELECTION-SCREEN ON VALUE-REQUEST FOR s_usnam-high.
**//To provide F4 help to S_USNAM-HIGH
PERFORM f_f4help_usnam USING 'S_USNAM-HIGH'.
*AT SELECTION-SCREEN ON VALUE-REQUEST FOR s_wbs-low.
**//To provide F4 help to S_WBS-LOW
PERFORM f_f4help_wbs USING 'S_WBS-LOW'.
*AT SELECTION-SCREEN ON VALUE-REQUEST FOR s_wbs-high.
**//To provide F4 help to S_WBS-HIGH
PERFORM f_f4help_wbs USING 'S_WBS-HIGH'.
*& Form f_f4help_usnam
To provide F4 help to username
-->P_0019 text
*FORM f_f4help_usnam USING value(p_0019) TYPE any.
**// To retrieve username from mkpf.
SELECT bname
FROM usr01
INTO TABLE it_usnam.
SORT: it_usnam BY usnam.
DELETE ADJACENT DUPLICATES FROM it_usnam COMPARING usnam.
CALL FUNCTION 'F4IF_INT_TABLE_VALUE_REQUEST'
EXPORTING
DDIC_STRUCTURE = ' '
retfield = c_retusnam
PVALKEY = ' '
dynpprog = c_dynpprog
dynpnr = c_dynpnr
dynprofield = p_0019
STEPL = 0
WINDOW_TITLE =
VALUE = ' '
value_org = c_s
MULTIPLE_CHOICE = ' '
DISPLAY = ' '
CALLBACK_PROGRAM = ' '
CALLBACK_FORM = ' '
MARK_TAB =
IMPORTING
USER_RESET =
TABLES
value_tab = it_usnam
field_tab = it_usnam.
return_tab = l_it_ret
DYNPFLD_MAPPING =
EXCEPTIONS
PARAMETER_ERROR = 1
NO_VALUES_FOUND = 2
OTHERS = 3
*ENDFORM. " f_f4help_usnam
*& Form f_f4help_wbs
To create F4 help for wbs element
-->P_0039 text
*FORM f_f4help_wbs USING value(p_0039) TYPE any.
**// To retrive wbs element from mseg
SELECT pspel
FROM pspl
INTO TABLE it_wbs.
SORT:it_wbs BY wbs.
DELETE ADJACENT DUPLICATES FROM it_wbs COMPARING wbs.
CALL FUNCTION 'F4IF_INT_TABLE_VALUE_REQUEST'
EXPORTING
DDIC_STRUCTURE = ' '
retfield = c_retwbs
PVALKEY = ' '
dynpprog = c_dynpprog
dynpnr = c_dynpnr
dynprofield = p_0039
STEPL = 0
WINDOW_TITLE =
VALUE = ' '
value_org = c_s
MULTIPLE_CHOICE = ' '
DISPLAY = ' '
CALLBACK_PROGRAM = ' '
CALLBACK_FORM = ' '
MARK_TAB =
IMPORTING
USER_RESET =
TABLES
value_tab = it_wbs
FIELD_TAB =
return_tab = l_it_ret1
DYNPFLD_MAPPING =
EXCEPTIONS
PARAMETER_ERROR = 1
NO_VALUES_FOUND = 2
OTHERS = 3
*ENDFORM. " f_f4help_wbs -
Selection-screen fields validation for dialog
Hello ABAP Gurus
Requirements: this is a report wherein , depending upon the correct select-options , user will pick some field values from table and some will be entered by the user in the next se51 custom screen for creation of a record in a ztable .
the problem is :without validating select-options values , it calls the se51 screen 100.
How to keep the cursor at the selection-screen field until & unless user enters the correct i/p s .if i/p are correct then only it should call screen 100 otherwise remain in the selection screen only .
*& Report ZSD_REP_QUOT_BANK_CREATE *
REPORT ZSD_REP_QUOT_BANK_CREATE NO STANDARD PAGE HEADING LINE-SIZE 255.
TABLES: VBAK,VBAP,VBRK,ZSD_TABL_QOTBANK,MARA,KONV.
DATA: OK_CODE LIKE SY-UCOMM,
SAVE_OK_CODE LIKE SY-UCOMM,
WA_ITAB LIKE ZSD_TABL_QOTBANK,
ANSWER TYPE C,
COPIED ,
STS TYPE N,
EMGRP LIKE MARA-EXTWG,
QTY LIKE ZSD_TABL_QOTBANK-QTY,
UPRICE LIKE ZSD_TABL_QOTBANK-UPRICE,
TOT LIKE ZSD_TABL_QOTBANK-TOT,
INO LIKE VBAP-POSNR.
SELECTION-SCREEN BEGIN OF BLOCK b1 WITH FRAME TITLE text-000.
SELECT-OPTIONS: S_QTNO FOR ZSD_TABL_QOTBANK-QTNO
NO INTERVALS NO-EXTENSION OBLIGATORY,
S_ITNO FOR ZSD_TABL_QOTBANK-ITNO
NO INTERVALS NO-EXTENSION OBLIGATORY.
S_MATNO FOR ZSD_TABL_QOTBANK-MATNO
NO INTERVALS NO-EXTENSION. "
SELECTION-SCREEN END OF BLOCK b1.
AT SELECTION-SCREEN.
SELECT SINGLE VBTYP
INTO VBAK-VBTYP
FROM VBAK
WHERE VBELN IN S_QTNO.
IF SY-SUBRC EQ 0 AND VBAK-VBTYP NE 'B'.
MESSAGE I005(ZQOTBANK).
SET CURSOR FIELD S_QTNO-LOW.
SUBMIT (SY-REPID) VIA SELECTION-SCREEN.
ENDIF.
CLEAR WA_ITAB.
SELECT SINGLE QTNO ITNO
INTO WA_ITAB
FROM ZSD_TABL_QOTBANK
WHERE QTNO IN S_QTNO
AND ITNO IN S_ITNO.
IF SY-SUBRC EQ 0.
MESSAGE I001(ZQOTBANK).
SET CURSOR FIELD S_QTNO-LOW.
SET CURSOR FIELD S_ITNO-LOW.
SUBMIT (SY-REPID) VIA SELECTION-SCREEN.
ENDIF.
*START-OF-SELECTION.
END-OF-SELECTION.
CALL SCREEN 0100.
*& Module STATUS_0100 OUTPUT
text
MODULE STATUS_0100 OUTPUT.
SET PF-STATUS '0100'.
SET TITLEBAR '0100'.
ZSD_TABL_QOTBANK-QTNO = S_QTNO-LOW.
SELECT SINGLE BUKRS_VF VKORG VTWEG SPART KUNNR ERDAT BNDDT
KNUMV
INTO (ZSD_TABL_QOTBANK-CCODE,
ZSD_TABL_QOTBANK-SORG,
ZSD_TABL_QOTBANK-DISTCHAN,
ZSD_TABL_QOTBANK-DIV,
ZSD_TABL_QOTBANK-CUSTNO,
ZSD_TABL_QOTBANK-QTDAT,
ZSD_TABL_QOTBANK-QTVALDAT,
VBAK-KNUMV)
FROM VBAK
WHERE VBELN IN S_QTNO
AND VBTYP = 'B'.
IF SY-SUBRC EQ 0.
SELECT SINGLE KWMENG POSNR MATNR
INTO (QTY , INO , ZSD_TABL_QOTBANK-MATNO)
FROM VBAP
WHERE VBELN IN S_QTNO.
SELECT SINGLE EXTWG
INTO EMGRP
FROM MARA
WHERE MATNR EQ ZSD_TABL_QOTBANK-MATNO.
ZSD_TABL_QOTBANK-ITNO = INO.
ZSD_TABL_QOTBANK-EMATGRP = EMGRP.
ZSD_TABL_QOTBANK-QTY = QTY.
SELECT SINGLE KBETR
INTO UPRICE
FROM KONV
WHERE KNUMV = VBAK-KNUMV
AND KPOSN = INO
AND KSCHL = 'PR00'.
ENDIF.
ZSD_TABL_QOTBANK-UPRICE = UPRICE.
TOT = QTY * UPRICE .
ZSD_TABL_QOTBANK-TOT = TOT .
CLEAR: QTY, UPRICE, TOT.
QTY = ZSD_TABL_QOTBANK-CGL_QTY.
UPRICE = ZSD_TABL_QOTBANK-CGL_UPRICE .
TOT = QTY * UPRICE .
ZSD_TABL_QOTBANK-CGL_TOT = TOT .
CLEAR: QTY, UPRICE, TOT.
QTY = ZSD_TABL_QOTBANK-BHEL_QTY.
UPRICE = ZSD_TABL_QOTBANK-BHEL_UPRICE .
TOT = QTY * UPRICE .
ZSD_TABL_QOTBANK-BHEL_TOT = TOT .
CLEAR: QTY, UPRICE, TOT.
QTY = ZSD_TABL_QOTBANK-BHEL_QTY.
UPRICE = ZSD_TABL_QOTBANK-BHEL_UPRICE .
TOT = QTY * UPRICE .
ZSD_TABL_QOTBANK-BHEL_TOT = TOT .
CLEAR: QTY, UPRICE, TOT.
QTY = ZSD_TABL_QOTBANK-ALSTOM_QTY.
UPRICE = ZSD_TABL_QOTBANK-ALSTOM_UPRICE .
TOT = QTY * UPRICE .
ZSD_TABL_QOTBANK-ALSTOM_TOT = TOT .
CLEAR: QTY, UPRICE, TOT.
QTY = ZSD_TABL_QOTBANK-SIEMENS_QTY.
UPRICE = ZSD_TABL_QOTBANK-SIEMENS_UPRICE .
TOT = QTY * UPRICE .
ZSD_TABL_QOTBANK-SIEMENS_TOT = TOT .
CLEAR: QTY, UPRICE, TOT.
QTY = ZSD_TABL_QOTBANK-TELK_QTY.
UPRICE = ZSD_TABL_QOTBANK-TELK_UPRICE .
TOT = QTY * UPRICE .
ZSD_TABL_QOTBANK-TELK_TOT = TOT .
CLEAR: QTY, UPRICE, TOT.
QTY = ZSD_TABL_QOTBANK-OTH_QTY.
UPRICE = ZSD_TABL_QOTBANK-OTH_UPRICE .
TOT = QTY * UPRICE .
ZSD_TABL_QOTBANK-OTH_TOT = TOT .
CLEAR: QTY, UPRICE, TOT.
ENDMODULE. " STATUS_0100 OUTPUT
*& Module USER_COMMAND_0100 INPUT
text
MODULE USER_COMMAND_0100 INPUT.
CASE OK_CODE.
WHEN 'SAVE'.
INSERT ZSD_TABL_QOTBANK.
IF SY-SUBRC EQ 0.
MESSAGE I000(ZQOTBANK).
COMMIT WORK.
CALL SELECTION-SCREEN 1000.
ELSE.
MESSAGE E001(ZQOTBANK).
CALL SELECTION-SCREEN 1000.
ENDIF.
ENDCASE.
ENDMODULE. " USER_COMMAND_0100 INPUT
*& Module EXIT_COMMAND INPUT
text
MODULE EXIT_COMAND INPUT.
SAVE_OK_CODE = OK_CODE.
CLEAR OK_CODE.
CASE SAVE_OK_CODE.
WHEN 'CANCEL'.
CALL FUNCTION 'POPUP_TO_CONFIRM'
EXPORTING
TITLEBAR = 'Quotation Bank Entry'
TEXT_QUESTION = 'Do you want to Cancel ?'
TEXT_BUTTON_1 = 'Yes'
TEXT_BUTTON_2 = 'No'
DEFAULT_BUTTON = '2'
IMPORTING
ANSWER = ANSWER.
IF ANSWER = '1'.
LEAVE PROGRAM.
ELSE.
CALL SELECTION-SCREEN 1000.
ENDIF.
WHEN 'EXIT'.
CALL FUNCTION 'POPUP_TO_CONFIRM'
EXPORTING
TITLEBAR = 'Quotation Bank Entry'
TEXT_QUESTION = 'Do you want to Exit ?'
TEXT_BUTTON_1 = 'Yes'
TEXT_BUTTON_2 = 'No'
DEFAULT_BUTTON = '2'
IMPORTING
ANSWER = ANSWER.
IF ANSWER = '1'.
LEAVE PROGRAM.
ELSE.
CALL SELECTION-SCREEN 1000.
ENDIF.
ENDCASE.
ENDMODULE. " EXIT_COMMAND INPUT
Thnx in AdvancePut the statement
CALL SCREEN 100
in the event <b>AT SELECTION-SCREEN</b> and NOT in <b>END-OF-SELECTION</b>.
Regards,
Subramanian V. -
Select List field in Form not pulling correct record
I have a report that displays a Product Name and a Host Name. Each product can reside on multiple hosts and each host has multiple products, hence an associative table with product_host_asgmt_id, product_id and host_id is defined.
The report I created selects data from the associative table and presents the user the product names and host names without a problem. the same report has an edit link that when selected will open a form that should display the selected host name and product name. In the form both of these fields are defined as Select List. The issue is that the list shows all the LOV but does not focus on the one that was selected in the report to edit.
I unhid the product_host_asgmt_id, product_id and host_id in the form and the values contained are correct, so I think the Automated Row Fetch is working. This same form needs to be used for editing and for creating new values hence the Select List.
I I have the Source section of the Host_name select list field set to : Only when current session state is null and the Source Type is an SQL query selecting all host_name form the host table.
Any ideas how to get the values selected in the report to appear in the form?
Thanks and apologize if this is trivial. I'm a rookie Apex user (but I like it).When you link to the form page, I assume you are passing the host_id value into a page item. Say you pass this value into item P2_HOST_ID, just make the select list item's Source Type Item (application or page item name) and enter P2_HOST_ID in the Source field.
This assumes that the lov query is of the form "select host_name d, host_id r from ...".
Be careful with Source Used "Only, ..." so that you never allow the page to display with a stale and unwanted value in P2_HOST_ID or that will produce an incorrect display value in the select list.
Scott
P.S. Please tell us your first name and put it into your handle and/or profile to help us. -
MS-SQL - Oracle SELECT INTO conversion problem...
Under MS-SQL (T-SQL) Select statement is defined as follows:
SELECT select_list
[INTO new_table_]
^^^^^^^^^^^^^^^^^^^^^
FROM table_source
[WHERE search_condition]
[GROUP BY group_by_expression]
[HAVING search_condition]
[ORDER BY order_expression [ASC | DESC] ]
Q:How under PL/SQL can one redirect sorted (ORDERed BY) results
from SELECT query to another table.
Slawek
nullI have asked the question because of the following reason:
I have a large select query that returns rows from a table in
different sort orders depending on user inputs, and I wonder if
there is any way to return just the rows between two specified
positions.
I figured that I'm going to either create one temporary table
with all the data (1000 records for example), sort the data in
the prefered order and use the rownum method to obtain the row
range (works fine under T-SQL). Other way is to try an inline
view that return the rownumber. I can then restrict the numer of
fields, e.g.
select empid, rowNumber from emp,
(select empid as id, rownum as rowNumber from emp) x
where empid = id
and rowNumber between 2 and 5
The problem is that under Oracle the subquery is not allowed to
have an ORDER BY clause (even if it had, rownum reflects row
numbers before they were sorted) and there is no SELECT into
TABLE_NAME.
Michael Malicky (guest) wrote:
: Slawek (guest) wrote:
: : Under MS-SQL (T-SQL) Select statement is defined as follows:
: : SELECT select_list
: : [INTO new_table_]
: : ^^^^^^^^^^^^^^^^^^^^^
: : FROM table_source
: : [WHERE search_condition]
: : [GROUP BY group_by_expression]
: : [HAVING search_condition]
: : [ORDER BY order_expression [ASC | DESC] ]
: : Q:How under PL/SQL can one redirect sorted (ORDERed BY)
results
: : from SELECT query to another table.
: : Slawek
: Order by is irrelevant when creating a new table out of a
: query, as the rows are NOT stored in any order in a table.
: The syntax for creating a new table out of an existing one
: is:
: CREATE TABLE new_table AS
: SELECT select_list FROM old_table
: WHERE ...
: etc.
: /mike
null -
How can I define select options fields as import paramter at Function Modules ?
Because I intend to pass select options fields to a FM in order to implement the below shown
code .
FUNCTION xyz
importing
ID
DESCRIPTION
CHANGING
REFERENCE(ZSC_INFO) TYPE SC_INFO
select * from SC_INFO into corresponding fields of table ZSC_INFO
where
ID in so_id and
DESCRIPTION in so_des and
ENDFUNCTIONHi,
The question is not completely clear to me but if you want to use the value of the select option and use it as an import parameter in a function module then some tips can be:
1. The value of the select option can be singles values or a range. Need to pick up the right values.
2. The import parameter and the variable you want to use must be of the same type.
DATA: tp_id TYPE <data type from the import parameter of the FM TEST>.
tp_id = so_vkorg-low "select option vkorg, you can use so_vkorg-high also for single values
CALL FM 'TEST'
IMPORT
ID = tp_id
EXPORT
DESCRIPTION = tp_description.
I hope that this is what you are looking for.
Best regards,
Guido Koopmann -
Select Options field width?
Hello,
In my WD view i have many Select Options fields which are grouped into various blocks. Now when i see the output all the Select Option fields within its block look good with equal widths between the text and field, but between various block levels the width isn't the same. Is there anyway i can control the width for Select Option field elements? Thanks.
Regards,
VasuHi Vasu.
AFAIK you do not have any chance to configure the layout of the select options.
You can only use blocks as you already did.
So why you do not use blocks for all your select options to avaoid this issue?
Cheers,
Sascha
Maybe you are looking for
-
Best audio format to embed for export to pdf?
Hello, I was wondering what format for audio file would be best to embed for exporting to pdf. I want to embed the audio file in a button, for playback on mouseover in the exported pdf. Previously, when I had CS3, I actually had to convert my mp3s to
-
Capturing line items in the routine-mail order sending problem
Hi I am sending Sales Order Output to the Email. I have configured the output type Using Option 'External Send' Option. But the Problem is Whenever there are blocks for Sales Order Email Should not be send. 1. When there is a block in Sales Order
-
Dynamic internal table and dynamic read statements.
Hi, My Scenario : I have two dynamic internal tables. I am looping at one internal table and trying to read another table. In the read statement how do I mention the key dyamically. Example code below : LOOP AT <dyn_table> ASSIGNING <dyn_wa>. read
-
Problem with: In-app purchases
I have redeemed a 20$ iTunes gift card onto my apple account and it shows that my balance is 20.80$. However, when I try to make an in-app purchase it says i have insufficient credit.
-
Dynamically append values to http url in BPEL http bindings
hi , I have a requirement where I have to post an xml over the http url 'http://todm2344:67033/access/auth'. I have created a wsdl file with http bindings and the schema that this url expects and invoked that wsdl from my bpel process. But now the re