How to pack & unpack in case of selection options
I have a Ztable having field
ztable-belnr.
Now i hav a report which fetch data according to belnr.
This is a section option:
select-options: belnr1 for Ztable-belnr.
Now if i enter 51 it shows no document
& if i enter '0000000051' it shows the data.
How to use pack unpack.Plz guide.
Regards.
Hi Abhut,
Check the data element of Ztable-belnr and then to domain to see if it has conversion routine ALPHA or other. If it doesn't have the conversion routine attached to this you need to do this manually in this program.
You need to use this code before you use this select options variable.
loop at belnr1.
if not belnr1-low is initial.
CALL FUNCTION 'CONVERSION_EXIT_ALPHA_INPUT'
EXPORTING
INPUT = belnr1-low
IMPORTING
OUTPUT = belnr1-low
endif.
if not belnr1-high is initial.
CALL FUNCTION 'CONVERSION_EXIT_ALPHA_INPUT'
EXPORTING
INPUT = belnr1-high
IMPORTING
OUTPUT = belnr1-high
endif,
modify belnr1.
endloop.
This fills the zeros automatically.
Regards,
Yellappa.
Similar Messages
-
Set Parameter id is not working in case of select-options
Hi,
i am using the below code to get the SWIA first field fill with some data which i am getting by logic written..but its not getting filled since in tcode the first input box is select-options not a parameter..if it would have been a parameter than my logic would have worked finest. so kindly suggest what to do now in case of select-options.
form user_command using p_ucomm type sy-ucomm
p_selfield type slis_selfield.
data : wi type sww_wiid .
clear : wi .
read table it_final into wa_final index p_selfield-tabindex.
if sy-subrc = 0.
check ( wa_final-wi_id is not initial ).
wi = wa_final-wi_id .
case p_ucomm.
when '&IC1'.
set parameter id 'WID' field wi.
call transaction 'SWIA'and skip first screen.
endcase.
endif.
endform.
Regards,
HiMThanQ..i got you totally..thanks to remind
Regards,
HiM -
How to restrict values displayed using a select-options
Can someone please tell me how to restrict values displayed using a select-options.
Example- in my table I have 100 entries. However when the user will click on the required field- I want to be display only 25 options based on a given value of another field in the table.
Thanks,
Mahesh.get the screen value for the selectd field using the fm
DYNP_VALUES_READ.
for that value filter the internal table values and pass the table to f4 help of the field.
below code will help u
write the f4 help for the field.
At Selection Screen on value request *
F4 help for Corporate
AT SELECTION-SCREEN ON VALUE-REQUEST FOR P_CORP.
Get Corporates for selected division
PERFORM GET_CORP.
PERFORM F4HELP_CORP.
*& Form GET_CORP
Get the corporates for the selected division
There are no interface parameters to be passed to this routine
FORM GET_CORP .
Table for conglomerate
DATA:
LT_CONG LIKE STANDARD TABLE OF FS_CORP,
Fields of current screen
LFS_DYNPREAD TYPE DYNPREAD,
Table for current Screen fields
LT_DYNPREAD LIKE STANDARD TABLE OF LFS_DYNPREAD.
LFS_DYNPREAD-FIELDNAME = 'P_DIV'.
APPEND LFS_DYNPREAD TO LT_DYNPREAD.
Get selection screen value for division
CALL FUNCTION 'DYNP_VALUES_READ'
EXPORTING
DYNAME = SY-REPID
DYNUMB = SY-DYNNR
TABLES
DYNPFIELDS = LT_DYNPREAD
EXCEPTIONS
INVALID_ABAPWORKAREA = 1
INVALID_DYNPROFIELD = 2
INVALID_DYNPRONAME = 3
INVALID_DYNPRONUMMER = 4
INVALID_REQUEST = 5
NO_FIELDDESCRIPTION = 6
INVALID_PARAMETER = 7
UNDEFIND_ERROR = 8
DOUBLE_CONVERSION = 9
STEPL_NOT_FOUND = 10
OTHERS = 11.
IF SY-SUBRC EQ 0.
READ TABLE LT_DYNPREAD INTO LFS_DYNPREAD INDEX 1.
IF SY-SUBRC EQ 0.
P_DIV = LFS_DYNPREAD-FIELDVALUE.
ENDIF. " IF SY-SUBRC EQ 0
ENDIF. " IF SY-SUBRC EQ 0
REFRESH T_CORP.
Get the conglomerate for the selected division
SELECT KUNNR " Conglomerate
FROM KNVH
INTO TABLE LT_CONG
WHERE HITYP EQ C_HITYP
AND VKORG EQ C_VKORG
AND VTWEG EQ C_VTWEG
AND SPART EQ P_DIV
AND DATAB LE SY-DATUM
AND DATBI GE SY-DATUM
AND HKUNNR EQ SPACE.
IF SY-SUBRC EQ 0.
SORT LT_CONG BY KUNNR.
DELETE ADJACENT DUPLICATES FROM LT_CONG
COMPARING KUNNR.
Get the corporates for the selected conglomerates
SELECT KUNNR " Customer Number
FROM KNVH
INTO TABLE T_CORP
FOR ALL ENTRIES IN LT_CONG
WHERE HITYP EQ C_HITYP
AND VKORG EQ C_VKORG
AND VTWEG EQ C_VTWEG
AND SPART EQ P_DIV
AND DATAB LE SY-DATUM
AND DATBI GE SY-DATUM
AND HKUNNR EQ LT_CONG-KUNNR.
IF SY-SUBRC NE 0.
CLEAR: SSCRFIELDS.
MESSAGE I531(0U) WITH TEXT-005.
STOP.
ENDIF. " IF SY-SUBRC NE 0
ELSE.
CLEAR: SSCRFIELDS.
MESSAGE I531(0U) WITH TEXT-004.
STOP.
ENDIF. " IF SY-SUBRC EQ 0
ENDFORM. " GET_CORP
*& Form F4HELP_CORP
F4 help for corporate
There are no interface parameters to be passed to this routine
FORM F4HELP_CORP .
F4 help for corporate
CALL FUNCTION 'F4IF_INT_TABLE_VALUE_REQUEST'
EXPORTING
RETFIELD = 'KUNNR'
DYNPPROG = 'Z_EXCESS_USAGE'
DYNPNR = '1000'
DYNPROFIELD = 'P_CORP'
VALUE_ORG = 'S'
TABLES
VALUE_TAB = T_CORP
EXCEPTIONS
PARAMETER_ERROR = 1
NO_VALUES_FOUND = 2
OTHERS = 3.
IF SY-SUBRC EQ 0.
Do nothing
ENDIF. " IF SY-SUBRC EQ 0
ENDFORM. " F4HELP_CORP -
How to set BDCDATA table for a SELECT-OPTIONS object?
Dear experts,
I have a transaction with PARAMETERS and SELECT-OPTIONS objects. This transaction will be called by another program by using CALL TRANSACTION 'mytransaction' USING mybdcdata statement. Below is some of the called transaction's source code:
DATA:
date TYPE sflight-fldate.
PARAMETERS:
p_carid TYPE sflight-carrid,
p_conid TYPE sflight-connid.
SELECT-OPTIONS:
so_date FOR date.
This is what I wrote in the calling program to define the values of the called transaction PARAMETERS fields:
DATA:
wa_bdcdata TYPE bdcdata,
it_bdcdata TYPE TABLE OF bdcdata.
wa_bdcdata-program = 'MYPROGRAM'.
wa_bdcdata-dynpro = '1000'.
wa_bdcdata-dynbegin = 'X'.
APPEND wa_bdcdata TO it_bdcdata.
CLEAR wa_bdcdata.
wa_bdcdata-fnam = 'P_CARID'.
wa_bdcdata-fval = 'AA'.
APPEND wa_bdcdata TO it_bdcdata.
CLEAR wa_bdcdata.
wa_bdcdata-fnam = 'P_CONID'.
wa_bdcdata-fval = '017'.
APPEND wa_bdcdata TO it_bdcdata.
CALL TRANSACTION 'MYTRANSACTION' USING it_bdcdata.
Unfortunately, I don't know how to set the values for the SELECT-OPTIONS screen fields. How to do this?
I've Googled this and tried several guesses but none was found or successful. Thanks in advance.
Regards,
HarisHi ,
Better go for SUBMIT report instead of CALL transaction ...
find the name of report being called on that transaction which you will be calling . Use that report name in SUBMIT
Just take help from below code .
Before using do please read by pressing f1 on SUBMIT syntax .
data:seltab type table of rsparams,
seltab_wa like line of seltab.
move: 'LANGU' to seltab_wa-selname,
'S' to seltab_wa-kind,
'I' to seltab_wa-sign,
'BT' to seltab_wa-option,
'D' to seltab_wa-low,
'I' to seltab_wa-high.
append seltab_wa to seltab.
clear seltab_wa.
move: 'E' to seltab_wa-sign,
'EQ' to seltab_wa-option,
'F' to seltab_wa-low,
space to seltab_wa-high.
append seltab_wa to seltab.
clear seltab_wa.
move: 'AUFNR' to seltab_wa-selname,
p_aufnr to seltab_wa-low.
append seltab_wa to seltab.
clear seltab_wa.
submit rkaep000 using selection-set 'VARIANT1'
with aufnr = p_aufnr
with selection-table seltab
exporting list to memory
and return .
regards
Deepak. -
How to write text name of parameters / select options in ABAP list??
Hi gurus, i must read the text name of parameterd / select options in ABAP program and write it in a list of the same program for log.......how can i do it??
Thanks in advance!
Best regards!
Ferdinando
Message was edited by:
Ferdinando SellittoHello Ferdinandino
Useful function modules are:
RS_PRINT_SELECTIONS
RS_LIST_SELECTION_TABLE (Generates list according to values in selection table(RSPARAMS))
RS_REFRESH_FROM_SELECTOPTIONS (Current contents of selection screen)
Function module RS_REFRESH_FROM_SELECTOPTIONS can provide the input for function module RS_LIST_SELECTION_TABLE.
Regards
Uwe -
How can I create a screen a select option inside a screen
Hello experts,
I have a screen '0100' and i need to create a select-options inside how can i do this? thanks in advance'Well did you search the forum first?
[select-option Dialog programming|
http://wiki.sdn.sap.com/wiki/display/stage/SELECT-OPTIONSonDialogprogrammingscreen]
And you can most definitely find more on SCN. -
How to get calender in f4 helpfor select options in module pool (urgent)
Hi All,
how to get calender in f4 help for select options in module pool
Please help .
Thanx in advance,
amrutaHi,
Check this Example..
Tables:Mara.
Select-options:s_matnr for mara-matnr.
Types:Begin of i_mara,
matnr like mara-matnr,
end of i_mara.
data:it_mara type standard table of i_mara.
At selection-screen on value-request for s_matnr-low.
Select matnr from mara into table it_mara.
CALL FUNCTION 'F4IF_INT_TABLE_VALUE_REQUEST'
EXPORTING
DDIC_STRUCTURE = ' '
RETFIELD = 'MATNR'
PVALKEY = ' '
DYNPPROG = SY-REPID
DYNPNR = SY-DYNNR
DYNPROFIELD = 'S_MATNR-LOW'
STEPL = 0
WINDOW_TITLE =
VALUE = ' '
VALUE_ORG = 'S'
MULTIPLE_CHOICE = ' '
DISPLAY = ' '
CALLBACK_PROGRAM = ' '
CALLBACK_FORM = ' '
MARK_TAB =
IMPORTING
USER_RESET =
TABLES
VALUE_TAB = IT_MARA
FIELD_TAB =
RETURN_TAB =
DYNPFLD_MAPPING =
EXCEPTIONS
PARAMETER_ERROR = 1
NO_VALUES_FOUND = 2
OTHERS = 3 -
How to hold data in parameter or select option
i have define parametrs/select option.
once i have run report , i will enter certain value in that parametrs or select option.when i run report again i want same value in that parametrs or select option which i enter previously.urgentHi
Try this:
DATA: NEXT_RUN.
PARAMETERS: P TYPE I.
START-OF-SELECTION.
WRITE P.
INITIALIZATION.
IMPORT NEXT_RUN FROM MEMORY ID SY-REPID.
IF SY-SUBRC <> 0.
NEXT_RUN = 'X'.
EXPORT NEXT_RUN TO MEMORY ID SY-REPID.
ENDIF.
AT SELECTION-SCREEN OUTPUT.
IF NEXT_RUN = 'X'.
P = 2.
ENDIF.
Max -
How to make htis code work with select options???
REPORT YTEST.
TABLES: MARA,MARC,MARD,MBEW,MVKE,MAKT.
DATA: BEGIN OF I_MARC OCCURS 0,
MATNR LIKE MARC-MATNR,
EKGRP LIKE MARC-EKGRP,
PSTAT LIKE MARC-PSTAT,
DISPO LIKE MARC-DISPO,
BESKZ LIKE MARC-beskz,
END OF I_MARC.
DATA: BEGIN OF I_MARD OCCURS 0,
MATNR LIKE MARD-MATNR,
LGORT LIKE MARD-LGORT,
ERSDA LIKE MARD-ERSDA,
WERKS LIKE MARD-WERKS,
END OF I_MARD.
DATA: BEGIN OF I_MBEW OCCURS 0,
MATNR LIKE MBEW-MATNR,
BWKEY LIKE MBEW-BWKEY,
PEINH LIKE MBEW-PEINH,
END OF I_MBEW.
DATA: BEGIN OF I_MARA OCCURS 0,
MATNR LIKE MARA-MATNR,
MTART LIKE MARA-MTART,
MATKL LIKE MARA-MATKL,
MEINS LIKE MARA-MEINS,
MBRSH LIKE MARA-MBRSH,
BSTME LIKE MARA-BSTME,
END OF I_MARA.
DATA: BEGIN OF I_MVKE OCCURS 0,
MATNR LIKE MVKE-MATNR,
VKORG LIKE MVKE-VKORG,
VTWEG LIKE MVKE-VTWEG,
VRKME LIKE MVKE-VRKME,
KONDM LIKE MVKE-KONDM,
END OF I_MVKE.
DATA: BEGIN OF I_MAKT OCCURS 0,
MATNR LIKE MAKT-MATNR,
SPRAS LIKE MAKT-SPRAS,
MAKTX LIKE MAKT-MAKTX,
END OF I_MAKT.
DATA: BEGIN OF I_OUT OCCURS 0,
MATNR LIKE MARC-MATNR,
MEINS LIKE MARA-MEINS,
MBRSH LIKE MARA-MBRSH,
MATKL LIKE MARA-MATKL,
MTART LIKE MARA-MTART,
BSTME LIKE MARA-BSTME,
WERKS LIKE MARD-WERKS,
EKGRP LIKE MARC-EKGRP,
PSTAT LIKE MARC-PSTAT,
DISPO LIKE MARC-DISPO,
BESKZ LIKE MARC-BESKZ,
LGORT LIKE MARD-LGORT,
ERSDA LIKE MARD-ERSDA,
BWKEY LIKE MBEW-BWKEY,
PEINH LIKE MBEW-PEINH,
VKORG LIKE MVKE-VKORG,
VTWEG LIKE MVKE-VTWEG,
VRKME LIKE MVKE-VRKME,
KONDM LIKE MVKE-KONDM,
SPRAS LIKE MAKT-SPRAS,
MAKTX LIKE MAKT-MAKTX,
END OF I_OUT.
select-options: s_matnr for marc-matnr.
SELECT MATNR EKGRP PSTAT DISPO BESKZ FROM MARC INTO
CORRESPONDING FIELDS OF TABLE I_MARC where matnr in s_matnr.
SELECT MATNR MTART MATKL MEINS MBRSH BSTME FROM MARA INTO
CORRESPONDING FIELDS OF
TABLE I_MARA FOR ALL ENTRIES IN I_MARC
WHERE MATNR EQ I_MARC-MATNR.
SELECT MATNR SPRAS MAKTX FROM MAKT INTO
CORRESPONDING FIELDS OF TABLE I_MAKT
FOR ALL ENTRIES IN I_MARC
WHERE MATNR = I_MARC-MATNR.
SELECT MATNR LGORT ERSDA WERKS FROM MARD INTO
CORRESPONDING FIELDS OF TABLE
I_MARD FOR ALL ENTRIES IN I_MAKT
WHERE MATNR = I_MAKT-MATNR.
SELECT MATNR BWKEY PEINH FROM MBEW INTO
TABLE I_MBEW
FOR ALL ENTRIES IN I_MARD
WHERE MATNR = I_MARD-MATNR.
SELECT MATNR VKORG VTWEG VRKME KONDM FROM MVKE INTO
TABLE I_MVKE
FOR ALL ENTRIES IN I_MBEW
WHERE MATNR = I_MBEW-MATNR.
LOOP AT I_MARC.
MOVE I_MARC-MATNR TO I_OUT-MATNR.
MOVE I_MARC-EKGRP TO I_OUT-EKGRP.
MOVE I_MARC-PSTAT TO I_OUT-PSTAT.
MOVE I_MARC-DISPO TO I_OUT-DISPO.
MOVE I_MARC-BESKZ TO I_OUT-BESKZ.
READ TABLE I_MARA WITH KEY MATNR = I_MARC-MATNR.
MOVE I_MARA-MTART TO I_OUT-MTART.
MOVE I_MARA-MBRSH TO I_OUT-MBRSH.
MOVE I_MARA-MEINS TO I_OUT-MEINS.
MOVE I_MARA-MATKL TO I_OUT-MATKL.
MOVE I_MARA-BSTME TO I_OUT-BSTME.
READ TABLE I_MAKT WITH KEY MATNR = I_MARC-MATNR.
MOVE I_MAKT-SPRAS TO I_OUT-SPRAS.
MOVE I_MAKT-MAKTX TO I_OUT-MAKTX.
READ TABLE I_MARD WITH KEY MATNR = I_MARC-MATNR.
MOVE I_MARD-LGORT TO I_OUT-LGORT.
MOVE I_MARD-ERSDA TO I_OUT-ERSDA.
MOVE I_MARD-WERKS TO I_OUT-WERKS.
READ TABLE I_MBEW WITH KEY MATNR = I_MARC-MATNR.
MOVE I_MBEW-BWKEY TO I_OUT-BWKEY.
MOVE I_MBEW-PEINH TO I_OUT-PEINH.
READ TABLE I_MVKE WITH KEY MATNR = I_MARC-MATNR.
MOVE I_MVKE-VKORG TO I_OUT-VKORG.
MOVE I_MVKE-VTWEG TO I_OUT-VTWEG.
MOVE I_MVKE-VRKME TO I_OUT-VRKME.
MOVE I_MVKE-KONDM TO I_OUT-KONDM.
APPEND I_OUT.
CLEAR I_OUT.
ENDLOOP.
Loop at i_out.
write:/ i_out-MATNR,
i_out-EKGRP,
i_out-PSTAT,
i_out-DISPO,
i_out-BESKZ,
i_out-LGORT,
i_out-ERSDA ,
i_out-WERKS,
i_out-BWKEY,
i_out-PEINH,
i_out-MTART,
i_out-MATKL,
i_out-MEINS,
i_out-MBRSH,
i_out-BSTME,
i_out-VKORG,
i_out-VTWEG,
i_out-VRKME,
i_out-KONDM,
i_out-SPRAS,
i_out-MAKTX.
endloop.
regards,
sriramREPORT YTEST.
TABLES: MARA,MARC,MARD,MBEW,MVKE,MAKT.
DATA: BEGIN OF I_MARC OCCURS 0,
MATNR LIKE MARC-MATNR,
EKGRP LIKE MARC-EKGRP,
PSTAT LIKE MARC-PSTAT,
DISPO LIKE MARC-DISPO,
BESKZ LIKE MARC-beskz,
END OF I_MARC.
DATA: BEGIN OF I_MARD OCCURS 0,
MATNR LIKE MARD-MATNR,
LGORT LIKE MARD-LGORT,
ERSDA LIKE MARD-ERSDA,
WERKS LIKE MARD-WERKS,
END OF I_MARD.
DATA: BEGIN OF I_MBEW OCCURS 0,
MATNR LIKE MBEW-MATNR,
BWKEY LIKE MBEW-BWKEY,
PEINH LIKE MBEW-PEINH,
END OF I_MBEW.
DATA: BEGIN OF I_MARA OCCURS 0,
MATNR LIKE MARA-MATNR,
MTART LIKE MARA-MTART,
MATKL LIKE MARA-MATKL,
MEINS LIKE MARA-MEINS,
MBRSH LIKE MARA-MBRSH,
BSTME LIKE MARA-BSTME,
END OF I_MARA.
DATA: BEGIN OF I_MVKE OCCURS 0,
MATNR LIKE MVKE-MATNR,
VKORG LIKE MVKE-VKORG,
VTWEG LIKE MVKE-VTWEG,
VRKME LIKE MVKE-VRKME,
KONDM LIKE MVKE-KONDM,
END OF I_MVKE.
DATA: BEGIN OF I_MAKT OCCURS 0,
MATNR LIKE MAKT-MATNR,
SPRAS LIKE MAKT-SPRAS,
MAKTX LIKE MAKT-MAKTX,
END OF I_MAKT.
DATA: BEGIN OF I_OUT OCCURS 0,
MATNR LIKE MARC-MATNR,
MEINS LIKE MARA-MEINS,
MBRSH LIKE MARA-MBRSH,
MATKL LIKE MARA-MATKL,
MTART LIKE MARA-MTART,
BSTME LIKE MARA-BSTME,
WERKS LIKE MARD-WERKS,
EKGRP LIKE MARC-EKGRP,
PSTAT LIKE MARC-PSTAT,
DISPO LIKE MARC-DISPO,
BESKZ LIKE MARC-BESKZ,
LGORT LIKE MARD-LGORT,
ERSDA LIKE MARD-ERSDA,
BWKEY LIKE MBEW-BWKEY,
PEINH LIKE MBEW-PEINH,
VKORG LIKE MVKE-VKORG,
VTWEG LIKE MVKE-VTWEG,
VRKME LIKE MVKE-VRKME,
KONDM LIKE MVKE-KONDM,
SPRAS LIKE MAKT-SPRAS,
MAKTX LIKE MAKT-MAKTX,
END OF I_OUT.
select-options: s_matnr for marc-matnr.
SELECT MATNR EKGRP PSTAT DISPO BESKZ FROM MARC INTO
CORRESPONDING FIELDS OF TABLE I_MARC where matnr in s_matnr.
if i_marc[] is not initial.
SELECT MATNR MTART MATKL MEINS MBRSH BSTME FROM MARA INTO
CORRESPONDING FIELDS OF
TABLE I_MARA FOR ALL ENTRIES IN I_MARC
WHERE MATNR EQ I_MARC-MATNR.
SELECT MATNR SPRAS MAKTX FROM MAKT INTO
CORRESPONDING FIELDS OF TABLE I_MAKT
FOR ALL ENTRIES IN I_MARC
WHERE MATNR = I_MARC-MATNR.
endif.
if i_makt[] is not initial.
SELECT MATNR LGORT ERSDA WERKS FROM MARD INTO
CORRESPONDING FIELDS OF TABLE
I_MARD FOR ALL ENTRIES IN I_MAKT
WHERE MATNR = I_MAKT-MATNR.
endif.
if i_mard[] is not initial.
SELECT MATNR BWKEY PEINH FROM MBEW INTO
TABLE I_MBEW
FOR ALL ENTRIES IN I_MARD
WHERE MATNR = I_MARD-MATNR.
endif.
if i_mbew[] is not initial.
SELECT MATNR VKORG VTWEG VRKME KONDM FROM MVKE INTO
TABLE I_MVKE
FOR ALL ENTRIES IN I_MBEW
WHERE MATNR = I_MBEW-MATNR.
endif.
LOOP AT I_MARC.
MOVE I_MARC-MATNR TO I_OUT-MATNR.
MOVE I_MARC-EKGRP TO I_OUT-EKGRP.
MOVE I_MARC-PSTAT TO I_OUT-PSTAT.
MOVE I_MARC-DISPO TO I_OUT-DISPO.
MOVE I_MARC-BESKZ TO I_OUT-BESKZ.
READ TABLE I_MARA WITH KEY MATNR = I_MARC-MATNR.
MOVE I_MARA-MTART TO I_OUT-MTART.
MOVE I_MARA-MBRSH TO I_OUT-MBRSH.
MOVE I_MARA-MEINS TO I_OUT-MEINS.
MOVE I_MARA-MATKL TO I_OUT-MATKL.
MOVE I_MARA-BSTME TO I_OUT-BSTME.
READ TABLE I_MAKT WITH KEY MATNR = I_MARC-MATNR.
MOVE I_MAKT-SPRAS TO I_OUT-SPRAS.
MOVE I_MAKT-MAKTX TO I_OUT-MAKTX.
READ TABLE I_MARD WITH KEY MATNR = I_MARC-MATNR.
MOVE I_MARD-LGORT TO I_OUT-LGORT.
MOVE I_MARD-ERSDA TO I_OUT-ERSDA.
MOVE I_MARD-WERKS TO I_OUT-WERKS.
READ TABLE I_MBEW WITH KEY MATNR = I_MARC-MATNR.
MOVE I_MBEW-BWKEY TO I_OUT-BWKEY.
MOVE I_MBEW-PEINH TO I_OUT-PEINH.
READ TABLE I_MVKE WITH KEY MATNR = I_MARC-MATNR.
MOVE I_MVKE-VKORG TO I_OUT-VKORG.
MOVE I_MVKE-VTWEG TO I_OUT-VTWEG.
MOVE I_MVKE-VRKME TO I_OUT-VRKME.
MOVE I_MVKE-KONDM TO I_OUT-KONDM.
APPEND I_OUT.
CLEAR I_OUT.
ENDLOOP.
Loop at i_out.
write:/ i_out-MATNR,
i_out-EKGRP,
i_out-PSTAT,
i_out-DISPO,
i_out-BESKZ,
i_out-LGORT,
i_out-ERSDA ,
i_out-WERKS,
i_out-BWKEY,
i_out-PEINH,
i_out-MTART,
i_out-MATKL,
i_out-MEINS,
i_out-MBRSH,
i_out-BSTME,
i_out-VKORG,
i_out-VTWEG,
i_out-VRKME,
i_out-KONDM,
i_out-SPRAS,
i_out-MAKTX.
endloop.
reward points to all helpful answers
kiran.M -
How to use read statement on a select options
Hi all,
I am trying to read the all the values on user selection screen select options.
I have an internal table loaded with data.
So while looping this internal table, I need to check the table certain tank field (lgort) against the select options tank values entered by user.
It is fine when user uses the multiple values on the select options since I use the "READ" statement on the select options and get the matching values.
Example: when user uses the multiple value selection on a select-options to enter values A554 and A555
The select-options table will be:
sign option low high
I EQ A554
I EQ A555
LOOP AT gt_output_location INTO gw_output.
READ TABLE s_lgort INTO gw_lgort WITH KEY low = gw_output-lgort.
IF sy-subrc = 0.
* append row to another table.
ENDIF.
ENDLOOP.
Problem:
Example: when user uses range on a select-options to enter values A554 and A555
sign option low high
I BT A554 A555
The read statement can only get matching value A554.
LOOP AT gt_output_location INTO gw_output.
READ TABLE s_lgort INTO gw_lgort WITH KEY low = gw_output-lgort.
IF sy-subrc = 0.
* append row to another table.
ENDIF.
ENDLOOP.
Anyone have any idea on this?? Thanks!!Hi all, I need to consider each and every lines of the gt_output_location as there are other fields need to consider also. Basically I am checking each and every lines of this table to see which lines I need to append to another table.
That is why I did not use "LOOP AT gt_output_location INTO gw_output WHERE lgort IN s_lgort"
The full gt_output_location:
LOOP AT gt_output_location INTO gw_output.
* IF p_lgort = space AND p_umlgo = space.
IF gv_lines_lgort = 0 AND gv_lines_umlgo = 0.
* only append those from tank <> to tank
IF gw_output-lgort <> gw_output-umlgo.
APPEND gw_output to gt_output.
CLEAR gw_output.
ELSE. "from tank == to tank
* append those from plant <> to plant
IF gw_output-werks <> gw_output-umwrk.
APPEND gw_output to gt_output.
CLEAR gw_output.
ENDIF.
ENDIF.
* ELSEIF p_lgort = space AND p_umlgo <> space.
ELSEIF gv_lines_lgort = 0 AND gv_lines_umlgo > 0.
* IF gw_output-umlgo = p_umlgo.
READ TABLE s_umlgo INTO gw_umlgo WITH KEY low = gw_output-umlgo.
IF sy-subrc = 0.
* only append those from tank <> to tank
IF gw_output-lgort <> gw_output-umlgo.
APPEND gw_output to gt_output.
CLEAR gw_output.
ELSE. "from tank == to tank
* append those from plant <> to plant
IF gw_output-werks <> gw_output-umwrk.
APPEND gw_output to gt_output.
CLEAR gw_output.
ENDIF.
ENDIF.
ENDIF.
* ELSEIF p_umlgo = space AND p_lgort <> space.
ELSEIF gv_lines_umlgo = 0 AND gv_lines_lgort > 0.
* IF gw_output-lgort = p_lgort.
READ TABLE s_lgort INTO gw_lgort WITH KEY low = gw_output-lgort.
IF sy-subrc = 0.
* only append those from tank <> to tank
IF gw_output-lgort <> gw_output-umlgo.
APPEND gw_output to gt_output.
CLEAR gw_output.
ELSE. "from tank == to tank
* append those from plant <> to plant
IF gw_output-werks <> gw_output-umwrk.
APPEND gw_output to gt_output.
CLEAR gw_output.
ENDIF.
ENDIF.
ENDIF.
ELSE.
* IF gw_output-lgort = p_lgort AND gw_output-umlgo = p_umlgo.
READ TABLE s_lgort INTO gw_lgort WITH KEY low = gw_output-lgort.
IF sy-subrc = 0.
* only append those from tank <> to tank
IF gw_output-lgort <> gw_output-umlgo.
APPEND gw_output to gt_output.
CLEAR gw_output.
ELSE. "from tank == to tank
* append those from plant <> to plant
IF gw_output-werks <> gw_output-umwrk.
APPEND gw_output to gt_output.
CLEAR gw_output.
ENDIF.
ENDIF.
ENDIF.
READ TABLE s_umlgo INTO gw_umlgo WITH KEY low = gw_output-umlgo.
IF sy-subrc = 0.
* only append those from tank <> to tank
IF gw_output-lgort <> gw_output-umlgo.
APPEND gw_output to gt_output.
CLEAR gw_output.
ELSE. "from tank == to tank
* append those from plant <> to plant
IF gw_output-werks <> gw_output-umwrk.
APPEND gw_output to gt_output.
CLEAR gw_output.
ENDIF.
ENDIF.
ENDIF.
ENDIF.
CLEAR gw_lgort.
CLEAR gw_umlgo.
ENDLOOP. -
How to restrict f4 help values in select options of Employee Search
Hi,
I am using HRASR_EMPLOYEE_SEARCH for employee search and created a new query ,infoset , usergroup which is responsible to fetch the selection criteria and result.I have one field in the search criteria as Cost Center which is connected to P0001-KOSTL.f4 help for that field fetches all the values(Local cost center,starts with M and Global Cost Center,starts with G)
I want to filter out the f4 values in WDA so that it can fetch values only starts with G
Thanks
Bala DuvvuriHi Bala,
Do you mean to say that when the user gets the OVS popup he should be able to use wildcard characters like G* in there? If thats your requirement then thats quite possible. You can do this within the phase 2 of the OVS. You first read the values that were entered by the user in the restriction screen by saying something like:
assign ovs_callback_object->query_parameters->* to <ls_query_params>.
You then fetch the desired attribute into a local variable like:
lv_matnr = <ls_query_params>-matnr.
Then you can say like:
REPLACE ALL OCCURRENCES OF '*' IN lv_matnr WITH '%' .
SELECT <your fields> FROM <table> INTO TABLE lt_select_list WHERE MATNR LIKE lv_matnr.
Hope that this is clear for you now. You can also try go through this [full example|http://****************/Tutorials/WebDynproABAP/OVS/page1.htm] where they have explained the same concept using step-by-step screenshots.
Regards,
Uday -
List Box - Object How do you get "allow multiple item selection" option to work?
developing a fillable PDF form using livecycle. I have several list boxes that contain multiple text items. I have entered all items directly into the item list and I have selected "allow multiple selection". The object is committed on exit, All the binding options have been left on default settings. BUT when the form is tested it will not allow multiple selections. I cannot find anything in help to resolve this. CAN Someone help me. This is urgent!!!!!
Dear Deb
Thank you for your suggestion, but it does not appear to work. I used the alt key then my mouse to select, but it still only allows for 1 selection. I do not see the sample you said you included, so I cannot check to see if I have a setting incorrect. If you have any other suggestions I would really appreciate it or if there is a way for you to look at the form, at this point I am open to any suggestions. -
Subject: How does one implement variable represents with Select Option?
All threads I read on SDN show examples with u2018EQu2019 or u2018BTu2019, Are there other values arrowed such as u2018CPu2019
According to help.sap.com, other values should be allowed, but as soon as I use them, e.g., CP (contain pattern), one gets java exception when running query?
http://help.sap.com/saphelp_nw70/helpdata/en/1d/ca10d858c2e949ba4a152c44f8128a/content.htm
Thanks.I found 'CP' does work. Vriable must represent Selction Option. If variable represnets single value or multiple single value then CP returns exceptiom.
-
How to initialize the Select Options
Hi,
I have 5 select-options and 3 parameters in my selection screen. I have to assign default values to the select-options.
I have S_VKORG for Sales Organization. The default values for this select-option are 'KF11', 'BH13', 'KF26'. How to assign the default vales to a Select-Option..? For a parameter, we do it by adding DEFAULT VALUE stament in the declaration itself. How to do it for Select-Option..?
The same way, for another Select-Option, I have 7 default values.
Please help me on the same how to assign default values to the select-option.
Thanks in advance,
Best Regards,
Paddu.PADDU,
INITIALZATION.
S_VKORG-OPTION = 'EQ' .
S_VKORG-SIGN = 'I'.
S_VKORG-LOW = 'KF11'.
S_VKORG-HIGH = ''.
APPEND s_vkorg.
CLEAR s_vkorg.
S_VKORG-OPTION = 'EQ' .
S_VKORG-SIGN = 'I'.
S_VKORG-LOW = 'BH13'.
S_VKORG-HIGH = ''.
APPEND s_vkorg.
CLEAR s_vkorg.
S_VKORG-OPTION = 'EQ' .
S_VKORG-SIGN = 'I'.
S_VKORG-LOW = 'KF26'.
S_VKORG-HIGH = ''.
APPEND s_vkorg.
CLEAR s_vkorg.
Don't forget to reward if useful.. -
How to degin a select-option in screen painter?
Help me !
How can i create an object like select-option in screen painter.
I want to input a range ,but there are no button or text in screen painter like select-option?hai u can create select options on screen but in little differernt way..
1st way : if u want to give only 1 interval then declare on screen as two different variables in same line
and after that append the value in ranges.
2nd way: here u can define as asingle input vriable beside that variable u can give a icon as extension in select option and give give some function code to that.if we click on that in user command write following code :
IF V_OKCODE = 'EXT'.
CALL FUNCTION 'COMPLEX_SELECTIONS_DIALOG'
EXPORTING
TITLE = 'Title'
TEXT = 'Text'
SIGNED = 'X'
LOWER_CASE = ' '
NO_INTERVAL_CHECK = ' '
JUST_DISPLAY = ' '
JUST_INCL = ' '
EXCLUDED_OPTIONS =
DESCRIPTION =
HELP_FIELD = 'T001W-WERKS'
SEARCH_HELP =
TABLES
RANGE = R_WERKS
EXCEPTIONS
NO_RANGE_TAB = 1
CANCELLED = 2
INTERNAL_ERROR = 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.
help field the field reference wich u want to declare and range is where values will be stored atomatically as in select options.
once we click the icon if we execute the function module a window will open as in selection option in reports.there user can enter the values.once the user enters the values it will stored automatically in ranges declared like r_werks in above example.
try it..
Maybe you are looking for
-
Scheduling Agreement - Backorder
Hi Gurus, Please suggest if back order concept has relevance with respect to scheduling agreement. We use Scheduling agreement and the configurations are set that system does backward scheduling only and always the system confirms the schedule lines
-
Servicegen - Issue with Variable Names - WLS 8.1
Hi Experts I am trying to expose an EJB as a Webservice.. I assembled the ear using SERVICEGEN exposed by Weblogic 8.1 To my dismay the generated WSDL (even the web-services.xml) are not having the variable names which I gave in my webservice method.
-
My company email is being blocked by Verizon. I've submitted numerous whitelist removal requests but nothing has changed.
-
NEWBIE-Using Mighty Mouse scroll wheel to control Color's SMH wheels
Hi, new here & new to Color, working thru Ripples iTunes Color tutorials right now. Loving Color so far. I hope to be back with less rudimentary questions one day but here's the 1st: Lacking a dedicated hardware interface, I'd hoped the Might Mouse s
-
How to load jpg if no flash player is installed
Hi, Not sure if I'm posting this in the right program forum or category... I'm trying to learn how to load a jpg instead of the flash movie if the user doesn't have flash player on his computer. Is there a tutorial somewhere? Would this be code I put