Problem in passing selection screen values using CALL TRANSACTION.
Hi All
I am facing problem in transfering selection screen values to the called transaction. I am trying to pass the path of the transaction filer but to no avail. The variable for filepath is not empty.
Below is my code:
DATA: lt_bdcdata TYPE TABLE OF bdcdata,
wa_bdcdata TYPE bdcdata,
opt TYPE ctu_params.
CLEAR wa_bdcdata.
wa_bdcdata-program = 'RFBASM00'.
wa_bdcdata-dynpro = '1000'.
wa_bdcdata-dynbegin = 'X'.
APPEND wa_bdcdata TO lt_bdcdata.
CLEAR wa_bdcdata.
wa_bdcdata-fnam = 'BDC_CURSOR'.
wa_bdcdata-fval = 'RFPDO1-FEBUMSF'.
APPEND wa_bdcdata TO lt_bdcdata.
CLEAR wa_bdcdata.
wa_bdcdata-fnam = 'RFPDO1-FEBUMSF'.
wa_bdcdata-fval = gv_filepath.
APPEND wa_bdcdata TO lt_bdcdata.
CLEAR wa_bdcdata.
wa_bdcdata-fnam = 'BDC_OKCODE'.
wa_bdcdata-fval = 'PASS'.
APPEND wa_bdcdata TO lt_bdcdata.
CLEAR wa_bdcdata.
opt-dismode = 'E'.
opt-updmode = 'S'.
CALL TRANSACTION 'FF_5' USING lt_bdcdata OPTIONS FROM opt.
Please help.
Harsh
Hi Harsh,
I think you have entered wrong main program for tcode 'FF_5' and wrong screen field for the file name. Use the below code instead of yours.
DATA: lt_bdcdata TYPE TABLE OF bdcdata,
wa_bdcdata TYPE bdcdata,
opt TYPE ctu_params,
gv_filepath type char128 value 'C:\testfile.txt'.
CLEAR wa_bdcdata.
wa_bdcdata-program = 'RFEBKA00'.
wa_bdcdata-dynpro = '1000'.
wa_bdcdata-dynbegin = 'X'.
APPEND wa_bdcdata TO lt_bdcdata.
CLEAR wa_bdcdata.
wa_bdcdata-fnam = 'BDC_CURSOR'.
wa_bdcdata-fval = 'UMSFILE'.
APPEND wa_bdcdata TO lt_bdcdata.
CLEAR wa_bdcdata.
wa_bdcdata-fnam = 'UMSFILE'.
wa_bdcdata-fval = gv_filepath.
APPEND wa_bdcdata TO lt_bdcdata.
CLEAR wa_bdcdata.
*wa_bdcdata-fnam = 'BDC_OKCODE'.
*wa_bdcdata-fval = 'PASS'.
*APPEND wa_bdcdata TO lt_bdcdata.
*CLEAR wa_bdcdata.
opt-dismode = 'A'.
opt-updmode = 'S'.
CALL TRANSACTION 'FF_5' USING lt_bdcdata OPTIONS FROM opt.
Thanks.
Regards,
Jey
Similar Messages
-
Passing select-options values using call transaction method
Hi Experts,
I have a scenario in which i have three fields BUKRS,WERKS and MATKL in an internal table i_tab and I have MATNR as a selection-option.
After this I have to use call transaction <tcode> for all the line items in the internal table and the MATNR select-option values I have to pass directly for each line of i_tab using call transaction method.
TYPES: BEGIN OF t_tab,
bukrs TYPE bukrs,
werks TYPE werks_d,
matkl TYPE matkl,
END OF t_tab.
DATA: w_tab TYPE t_tab,
i_tab TYPE STANDARD TABLE OF t_tab.
SELECT-OPTIONS: s_matnr FOR marc-matnr.
Now I am putting a loop at i_tab and have to use CALL TRANSACTION <TCODE> for each line with the SELECT-OPTIONS for MATNR.
Please tell me whether we can pass multiple ranges for MATNR using call transcation method.
for example there can be multiple single values/multiple ranges/excluded ranges for MATNR. so please suggest me how tho achieve this sceanrio using CALL transaction method of BDC.
Thanks a lot.
Regards,
KrishanHi Krishan,
For the Call transaction TCODE there is extension ....OPTIONS from OPT. Just Check it out. I think it is possible like this.
... OPTIONS FROM opt
*Effect*
This addition gives you control using the values of the components of the structure opt, which must be of the Dictionary type CTU_PARAMS. The components have the following meaning:
DISMODE
Processing mode (comparable with the MODE addition)
UPDMODE
Update mode (comparable with the UPDATE addition)
CATTMODE
CATT mode (controlling a CATT procedure)
The CATT mode can have the following values:
' ' No CATT procedure active
'N' CATT procedure without single screen control
'A' CATT procedure with single screen control
DEFSIZE
Use standard window size
RACOMMIT
COMMIT WORK does not end CATT procedure
NOBINPT
No batch input mode, that s SY-BINPT = SPACE.
NOBIEND
No batch input mode after BDC data has been read
The components DEFSIZE , RACOMMIT, NOBINPT, NOBIEND always take the following values:
'X' Yes
' ' No
If the OPTIONS addition is omitted, the following settings are valid for the control parameters:
DISMODE from the MODE addition
UPDMODE
from the UPDATE addition
CATTMODE
No CATT procedure active
DEFSIZE
Do not use standard window size
RACOMMIT
COMMIT WORK ends procedure successfully
NOBINPT
Batch input mode, that is SY-BINPT =X.
NOBIEND
Batch input mode also active after BDC data has been read
Regards,
Swapna. -
Pass selection screen value to ALV
Hi
I need to pass selection screen values to ALV top of page. How to do this?Hi,
Have a look on the following example.
TYPE-POOLS: SLIS.
TABLES: LFA1.
SELECT-OPTIONS: LIFNR FOR LFA1-LIFNR.
DATA: BEGIN OF ITAB OCCURS 0,
LIFNR LIKE LFA1-LIFNR,
NAME1 LIKE LFA1-NAME1,
ORT01 LIKE LFA1-ORT01,
LAND1 LIKE LFA1-LAND1,
REGIO LIKE LFA1-REGIO,
END OF ITAB.
SELECT * FROM LFA1 INTO CORRESPONDING FIELDS OF TABLE ITAB UP TO 5 ROWS.
DATA: LAYOUT TYPE SLIS_LAYOUT_ALV,
HEADER TYPE SLIS_T_LISTHEADER WITH HEADER LINE,
FLDCAT TYPE SLIS_T_FIELDCAT_ALV.
CALL FUNCTION 'REUSE_ALV_FIELDCATALOG_MERGE'
EXPORTING
I_PROGRAM_NAME = SY-REPID
I_INTERNAL_TABNAME = 'ITAB'
I_STRUCTURE_NAME = ITAB
I_CLIENT_NEVER_DISPLAY = 'X'
I_INCLNAME = SY-REPID
I_BYPASSING_BUFFER =
I_BUFFER_ACTIVE =
CHANGING
CT_FIELDCAT = FLDCAT
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_GRID_DISPLAY'
EXPORTING
I_INTERFACE_CHECK = ' '
I_BYPASSING_BUFFER = ' '
I_BUFFER_ACTIVE = ' '
I_CALLBACK_PROGRAM = SY-REPID
I_CALLBACK_PF_STATUS_SET = ' '
I_CALLBACK_USER_COMMAND = ' '
I_CALLBACK_TOP_OF_PAGE = '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 = FLDCAT
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 = 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.
DATA: S(10).
S = 'TO'.
FORM TOP-OF-PAGE.
HEADER-TYP = 'S'.
HEADER-KEY = 'LIFNR'.
CONCATENATE LIFNR-LOW LIFNR-HIGH INTO HEADER-INFO SEPARATED BY SPACE.
APPEND HEADER.
CALL FUNCTION 'REUSE_ALV_COMMENTARY_WRITE'
EXPORTING
IT_LIST_COMMENTARY = HEADER[]
I_LOGO =
I_END_OF_LIST_GRID =
I_ALV_FORM =
ENDFORM.
Reward,if useful.
Thanks,
Chandu -
How to pass Selection screen values to another program's selection screen
Hello,
I have a requriement where in which i need to pass the selection screen values (say list of pernrs) and few others of one program to selection screen of another.
One option that i came across is using Submit. But am unware how to pass only the selection screen values (there wont be any data processing or filtering). Just the values of one prgm's selection screen are to be sent to another.
Thanks
RKprog1.
data:lt_params type table of RSPARAMS.
data:wa like line of lt_params.
parameters:pa1 type sy-datum.
select-options:so1 type sy-dtaum.
wa-SELNAME = 'PA2'. "Seletion screen field name
wa-KIND = 'P'. "P-Parameter,S-Select-options
wa-SIGN = 'I'. "I-in
wa-OPTION = 'EQ'. "EQ,BT,CP
wa-LOW = pa1. "Selection Option Low,Parameter value
append wa to lt_params.
loop at so1.
wa-SELNAME = 'SO2'. "Seletion screen field name
wa-KIND = 'S'. "P-Parameter,S-Select-options
wa-SIGN = 'I'. "I-in
wa-OPTION = 'EQ'. "EQ,BT,CP
wa-LOW = so1-low. "Selection Option Low,Parameter value
wa-HIGH = so1-high. "Selection Option Low,Parameter value
append wa to lt_params.
endloop.
CALL FUNCTION 'SUBMIT_REPORT'
EXPORTING
report = 'ZPROG2.' "report name of ur tocde
RET_VIA_LEAVE = '' "IF 'X' returns to the called program after execution
SKIP_SELSCREEN = 'X' "If 'X' selection screen of called program is not displayed
TABLES
SELECTION_TABLE = lt_params "Contains values to the selection screen
EXCEPTIONS
JUST_VIA_VARIANT = 1
NO_SUBMIT_AUTH = 2
OTHERS = 3
Prog2.
parameters:pa2 type sy-datum.
select-options:so2 type sy-dtaum.
write pa2.
skip 1.
loop at so2.
write:so2-low,so2-high.
skip 1.
endloop.
Edited by: Keshu Thekkillam on Aug 20, 2009 3:22 PM -
Selection screen value use as a header SQ01
Can anybody please tell me how to pick the values from the selection screen and use them as a header in SAP Query sq01
Arnulfo,
For this first you nedd to decalre the selection screens in infoset level.Means
1. Goto SQ02 -
Press Extras button--> Selections->Create>Popup will get display>Name(Ex: S_matnr))->Enter and select radio button Select options or parameters->Give description and Short text (it will display as label name for selection screen elemnts)
<b>---- understood</b>
against format for (if selectt options)----
MARA-matnr
against LIKE (If parameters) -
MARA-matnr.
<b>----you mean the data type of the one i will be displaying in selection screen??</b>
Under START-of-selection event in infoset.
Now in your code you can catch the values for s_matnr . and pass these values to final internal table.Heder data should be in first record.
<b>----i dont get this.. please be specific:o(</b>
In extras declare the header record fields and
Now use Record processing event.
read the records of internal table and pass those header data to extra fields.
Move these extras fields to field groups and select those in SQ01 for output.
Don't forget to reward if useful.....
and read the final inter -
How to pass selection screen value to LDB dynamic field.
Hello everybody,
In my program, I am using standard LDB(PSJ) for getting data. And there is a requirement that I have to display some dynamic fields on my selection screen like plant , person responsible ( which are mandatory also ) etc. and inside the program I have to fill those dynamic fields for which the user has entered the value in selection screen.
Could you please tell me how to pass some of selection screen values to ldb dynamic fields before GET statement.
Thanks !!!
Regards,
Mitra>
Pavan Bhamidipati wrote:
> Hi,
>
>
I have to fill those dynamic fields for which the user has entered the value in selection screen.
>
>
> This means that the user is going to enter the values in the selection screen for the dynamic field values so
>
> SET PARAMETERID 'XYZ' FIELD p_field.
>
> where p_field is a parameter on the selection screen
>
> Regards
> Pavan
You can capture the values selected through the dynamic selections using some of the functions modules below, just search the forum for the below FM's, perhaps you can find some sample code
FREE_SELECTIONS_EX_2_RANGE
FREE_SELECTIONS_EX_2_WHERE
FREE_SELECTIONS_RANGE_2_EX
FREE_SELECTIONS_RANGE_2_WHERE
FREE_SELECTIONS_WHERE_2_EX
FREE_SELECTIONS_WHERE_2_RANGE -
How to clear all selection screen parameters before calling transaction?
Hi Experts
I have a ABAP report that displays data using ALV.
When I double click a cell it calls transaction MB51. Before calling the transaction I need to set some parameters of the selection screen of the transaction.
My code is like below:
<UL>
<LI>FREE MEMORY ID 'MAT'. <I>"material</I>
<LI> FREE MEMORY ID 'WRK'. <I>"plant</I>
<LI> FREE MEMORY ID 'CHA'. <I>"batch</I>
<LI><I>* Get the selected ALV row data</I>
<LI>READ TABLE i_recon INDEX p_selfield-tabindex INTO x_recon.
<LI><I>* If link MB51 is clicked then open tcode MB51</I>
<LI> IF p_selfield-sel_tab_field+8(4) = 'MB51'.
<LI><I>* Pass material, plant to the corresponding tcode</I>
<LI> SET PARAMETER ID 'MAT' FIELD x_recon-matnr.
<LI> SET PARAMETER ID 'WRK' FIELD p_plant.
<LI> CALL TRANSACTION 'MB51' AND SKIP FIRST SCREEN.
</UL>
The problem is:
<UL> <LI> 1. First, I run the given transaction before running the report in a separate session with some set of values in the selection screen. For example: plant = AB01, Material = 990001 and Batch = 10001.</LI>
</UL>
<UL>
<LI> 2. Then in another session I run my report. In the report ALV I have selected a record where plant = AB01, Material = 990001 but Batch is blank. But it opens the transaction with plant = AB01, Material = 990001 and Batch = 10001.
Even though in my ALV record the batch is blank yet it uses the batch value from the memory. That is, the batch value that was given in the transaction earlier. Why it is not getting cleared? I have also used FREE MEMORY ID code in the beginning. But still it is not clearing the values in the memory.
</UL>
<UL>
<LI>What shall I do to clear all the selection screen parameters before calling the transaction?</LI>
</UL>
<UL>
<LI>
Thanks
Gopal
</LI>
</UL>
Edited by: gopalkrishna baliga on Aug 11, 2010 10:29 AMIts because sap memory is globally shared.
Do it like this.
READ TABLE i_recon INDEX p_selfield-tabindex INTO x_recon.
IF p_selfield-sel_tab_field+8(4) = 'MB51'.
perform bdc_dynpro using 'RM07DOCS' '1000'.
perform bdc_field using 'BDC_OKCODE' '=ONLI'.
perform bdc_field using 'MATNR-LOW' x_recon-matnr.
perform bdc_field using 'WERKS-LOW' p_plant.
perform bdc_field using 'CHARG-LOW' p_batch.
perform bdc_field using 'DATABASE' 'X'.
call transaction 'MB51' with i_bdcdata mode 'E'.
endif.
form bdc_dynpro using program dynpro.
clear la_bdcdata.
la_bdcdata-program = program.
la_bdcdata-dynpro = dynpro.
la_bdcdata-dynbegin = 'X'.
append la_bdcdata to i_bdcdata.
endform.
form bdc_field using fnam fval.
clear la_bdcdata.
la_bdcdata-fnam = fnam.
la_bdcdata-fval = fval.
append la_bdcdata to i_bdcdata.
endform. -
Passing selection screen values to the next report using CALL TRANSACTION
Hi experts,
I have 2 reports. In the first report i have the 3 input fields in the first report, how do i pass the values to the next report which is transaction: ZKKBC_PKO_2.
I want to display in the next report the selections that the user previously selected.
First report:
SELECTION-SCREEN BEGIN OF BLOCK b1 WITH FRAME TITLE text-001.
PARAMETERS: COMP LIKE AFRU-WERKS OBLIGATORY MODIF ID s1.
PARAMETERS: PERIOD LIKE COEP-PERIO OBLIGATORY MODIF ID s1.
PARAMETERS: YEAR LIKE COEP-GJAHR OBLIGATORY MODIF ID s1.
SELECTION-SCREEN END OF BLOCK b1.
CALL TRANSACTION 'ZKKBC_PKO_2'.
Anyone can help me?
Thanks,
LawrenceHi experts,
What i did is this:
Using SET PARAMETER
in the first report
SET PARAMETER ID 'WRK' FIELD COMP.
SET PARAMETER ID 'VPE' FIELD PERIOD.
SET PARAMETER ID 'GJR' FIELD YEAR.
CALL TRANSACTION 'ZKKBC_PKO_2'.
Second Report
SELECTION-SCREEN BEGIN OF BLOCK blk1 WITH FRAME TITLE text-001.
PARAMETERS: WRK LIKE AFRU-WERKS.
PARAMETERS: VPE LIKE COEP-PERIO.
PARAMETERS: GJR LIKE COEP-GJAHR.
SELECTION-SCREEN END OF BLOCK blk1.
Using SUBMIT
First Report
SELECTION-SCREEN BEGIN OF BLOCK b1 WITH FRAME TITLE text-001.
PARAMETERS: COMP LIKE AFRU-WERKS OBLIGATORY MODIF ID s1.
PARAMETERS: PERIOD LIKE COEP-PERIO OBLIGATORY MODIF ID s1.
PARAMETERS: YEAR LIKE COEP-GJAHR OBLIGATORY MODIF ID s1.
SELECTION-SCREEN END OF BLOCK b1.
SUBMIT ZCO_PRDCOST_ACTUAL_2 VIA SELECTION-SCREEN USING SELECTION-SETS OF PROGRAM 'ZCO_PRDCOST_ACTUAL_1' AND RETURN.
Second Report:
GET PARAMETER ID 'WRK' FIELD comp.
GET PARAMETER ID 'VPE' FIELD COEP-PERIO.
GET PARAMETER ID 'GJR' FIELD YEAR.
Either this 2 ways i still cannot get the first report selection values on the 2nd report. Can someone help me see if my codes is correcT? -
Regarding passing selection screen values into internal table
Hi,
I have created one selection screen with fields
<b>POSNR LIKE VBAP-POSNR</b>
<b>SELECT-OPTIONS: s_posnr FOR vbap-posnr.</b>
I had created one internal table as:
<b>DATA: BEGIN OF i_item OCCURS 0,
posnr LIKE vbap-posnr,
END OF i_item.</b>
Now what i want is to pass what ever entries available in <b>s_posnr into i_item</b> internal table.
If user gives 10 in select-screen i_item should have 10,
If user gives 10 to 30 in select-screen i_item should have 10,20,30 entries.
If user gives nothing in s_posnr of selection screen
then i_item should have all the valid item no's[POSNR's]
from respective sales order.
Can anybody tell me how can i solve this issue!
Thanks in advance.
Thanks & Regards,
Prasad.Hi Prasad,
I guess somewhere on your selection screen there is also a parameter for sales order (eg. pa_vbeln)?
Then:
SELECT posnr
FROM vbap
INTO TABLE i_item
WHERE vbeln EQ pa_vbeln
AND posnr IN s_posnr.
Will get all position numbers in your internal table.
Regards,
John. -
How can I get selection screen values from outside of program?
Hi. all.
Now. I'm developing moritoring systems and I have problems. for getting selection screen values in runtime. Is there any function, methods or structure to know this?
I'd like to get selection screen values while several programs working in runtime and update these values to table to show current system's status and input values for users in real time.
For example.
Now. 3 PGMs are working on systems.
each PGM is ZAAA01, ZAAA02, ZAAA03.
and ZAAA01 needs input parameter P01, ZAAA02 needs input parameter P02, ZAAA03 needs input parameter P03.
In this case, I have to know values of P01, P02 and P03.
The mornitoring systems will show current working status of PGMs(ZAAA01~03)' and these PGMs' input values.
As fas as I know, the structure 'SCREEN' can be used in each PGM for runtime. Is there any SAP system structure or something else for this purpose?
I hope your hopeful repsponse.
Thanks.Umm..I need to explain more about this.
of course I know SET, GET PARAMETERS.
But I'd like to minimize coding for each PGM level.
I have over hundreds PGMs and I have to develop the PGM(including tables and structures) that mornitor
all of those PGMs on a report in real-time.
This PGM is kind of Process Manager.
First I should know dialogue job PGM and background job that pass parameters using SAP(ABAP) Memory.
And then I have to update those PGMs' input values via screens into tables in real-time.
So, I couldn't use SET,GET PARAMETERS for this PGM.
I want to know methods that can be used for getting information about runtime PGMs' selection screen field values in SAP systems wide.
Please help me some one knows this. -
JOB_SUBMIT with Selection Screen Value
I have a requirement :
with other select-options and parameters, i have two radio button, Foreground and Background:
when Background radio button will be selected program should be scheduled as a background job.
How i will pass selection screen value in JOB_SUBMIT ??
Cheers.
SrikantaHi ,
Try This
*& Report ZMMVB_PG_SL_CHANGE_BDC
REPORT zmmvb_pg_sl_change_bdc.
TABLES : mara,t133a,marc.
DATA i_t133a LIKE t133a OCCURS 0 WITH HEADER LINE.
DATA : BEGIN OF itab OCCURS 0,
matnr LIKE marc-matnr,
werks LIKE marc-werks,
ekgrp LIKE marc-ekgrp,
END OF itab.
DATA : BEGIN OF itab1 OCCURS 0,
matnr LIKE marc-matnr,
werks LIKE marc-werks,
dispo LIKE marc-dispo,
END OF itab1.
DATA : fname LIKE ibipparms-path ,
ename TYPE string,
mode.
DATA: BEGIN OF it_t133a OCCURS 0,
bilds LIKE t133a-bilds,
pstat LIKE t133a-pstat,
guifu LIKE t133a-guifu,
auswg LIKE t133a-auswg,
END OF it_t133a.
DATA: ctr TYPE i,
ctr_s(2) TYPE n,
wrk(35),
ch(1),
viewno(2) TYPE n,
guifu LIKE t133a-guifu.
DATA: BEGIN OF it_views OCCURS 30.
INCLUDE STRUCTURE mbildtab. " Selection Views
DATA: END OF it_views.
DATA bdc_data LIKE bdcdata OCCURS 0 WITH HEADER LINE.
SELECTION-SCREEN BEGIN OF BLOCK b WITH FRAME TITLE text-000.
PARAMETERS : ek RADIOBUTTON GROUP rg1 ,
sl RADIOBUTTON GROUP rg1
SELECTION-SCREEN END OF BLOCK b.
SELECTION-SCREEN BEGIN OF BLOCK c WITH FRAME TITLE text-001.
PARAMETERS : fg RADIOBUTTON GROUP rg2 DEFAULT 'X',
bg RADIOBUTTON GROUP rg2.
SELECTION-SCREEN END OF BLOCK c.
START-OF-SELECTION.
IF fg = 'X'.
mode = 'A'.
ELSEIF bg = 'X'.
mode = 'E'.
ENDIF.
IF ek = 'X'.
guifu = 'SP09'.
PERFORM bdc_ekgrp_change.
ELSEIF sl = 'X'.
guifu = 'SP12'.
PERFORM bdc_mrpcontroller_change.
ENDIF.
*& Form BDC_EKGRP_CHANGE
* text
* --> p1 text
* <-- p2 text
FORM bdc_ekgrp_change .
CALL FUNCTION 'F4_FILENAME'
EXPORTING
program_name = sy-repid
dynpro_number = sy-dynnr
field_name = ' '
IMPORTING
file_name = fname.
IF NOT ( fname IS INITIAL ) .
ename = fname .
ENDIF.
CALL FUNCTION 'GUI_UPLOAD'
EXPORTING
filename = ename
filetype = 'DAT'
TABLES
data_tab = itab
EXCEPTIONS
file_open_error = 1
file_read_error = 2
no_batch = 3
gui_refuse_filetransfer = 4
invalid_type = 5
no_authority = 6
unknown_error = 7
bad_data_format = 8
header_not_allowed = 9
separator_not_allowed = 10
header_too_long = 11
unknown_dp_error = 12
access_denied = 13
dp_out_of_memory = 14
disk_full = 15
dp_timeout = 16
OTHERS = 17.
IF sy-subrc <> 0.
* MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
* WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
IF itab[] IS NOT INITIAL.
LOOP AT itab.
REFRESH bdc_data.
IF itab-matnr NA sy-abcde AND itab-matnr NA '/*-_.'.
UNPACK itab-matnr TO itab-matnr.
ELSE.
TRANSLATE itab-matnr TO UPPER CASE.
ENDIF.
SELECT SINGLE * FROM mara WHERE matnr = itab-matnr.
IF sy-subrc NE 0.
CONTINUE.
ENDIF.
PERFORM view_routine.
PERFORM bdc_dynpro USING 'SAPLMGMM' '0060'.
PERFORM bdc_field USING 'BDC_CURSOR'
'RMMG1-MATNR'.
PERFORM bdc_field USING 'BDC_OKCODE'
'/00'.
PERFORM bdc_field USING 'RMMG1-MATNR'
itab-matnr.
CONCATENATE 'MSICHTAUSW-DYTXT(' viewno ')' INTO wrk.
CONDENSE wrk NO-GAPS.
PERFORM bdc_dynpro USING 'SAPLMGMM' '0070'.
PERFORM bdc_field USING 'BDC_CURSOR'
wrk. "'MSICHTAUSW-DYTXT(08)'.
PERFORM bdc_field USING 'BDC_OKCODE'
'=ENTR'.
CONCATENATE 'MSICHTAUSW-KZSEL(' viewno ')' INTO wrk.
CONDENSE wrk NO-GAPS.
PERFORM bdc_field USING wrk "'MSICHTAUSW-KZSEL(08)'
'X'.
PERFORM bdc_dynpro USING 'SAPLMGMM' '0080'.
PERFORM bdc_field USING 'BDC_CURSOR'
'RMMG1-WERKS'.
PERFORM bdc_field USING 'BDC_OKCODE'
'=ENTR'.
PERFORM bdc_field USING 'RMMG1-WERKS'
itab-werks.
PERFORM bdc_dynpro USING 'SAPLMGMM' '4000'.
PERFORM bdc_field USING 'BDC_OKCODE'
'=BU'.
* PERFORM bdc_field USING 'MAKT-MAKTX'
* '"HEX BOLT M16X1.5X100,B8.8,BP"'.
PERFORM bdc_field USING 'BDC_CURSOR'
'MARC-EKGRP'.
* PERFORM bdc_field USING 'MARA-MEINS'
* 'NOS'.
PERFORM bdc_field USING 'MARC-EKGRP'
itab-ekgrp.
* PERFORM bdc_field USING 'MARA-MATKL'
* '1702'.
* PERFORM bdc_field USING 'MARC-USEQU'
* '3'.
* PERFORM bdc_field USING 'MARC-KORDB'
* 'X'.
CALL TRANSACTION 'MM02' USING bdc_data MODE mode UPDATE 'S'.
ENDLOOP.
ENDIF.
ENDFORM. " BDC_EKGRP_CHANGE
*& Form BDC_MRPCONTROLLER_CHANGE
* text
* --> p1 text
* <-- p2 text
FORM bdc_mrpcontroller_change .
CALL FUNCTION 'F4_FILENAME'
EXPORTING
program_name = sy-repid
dynpro_number = sy-dynnr
field_name = ' '
IMPORTING
file_name = fname.
IF NOT ( fname IS INITIAL ) .
ename = fname .
ENDIF.
CALL FUNCTION 'GUI_UPLOAD'
EXPORTING
filename = ename
filetype = 'DAT'
TABLES
data_tab = itab1
EXCEPTIONS
file_open_error = 1
file_read_error = 2
no_batch = 3
gui_refuse_filetransfer = 4
invalid_type = 5
no_authority = 6
unknown_error = 7
bad_data_format = 8
header_not_allowed = 9
separator_not_allowed = 10
header_too_long = 11
unknown_dp_error = 12
access_denied = 13
dp_out_of_memory = 14
disk_full = 15
dp_timeout = 16
OTHERS = 17.
IF sy-subrc <> 0.
* MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
* WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
IF itab1[] IS NOT INITIAL.
LOOP AT itab1.
REFRESH bdc_data.
IF itab1-matnr NA sy-abcde AND itab1-matnr NA '/*-_.'.
UNPACK itab1-matnr TO itab1-matnr.
ELSE.
TRANSLATE itab1-matnr TO UPPER CASE.
ENDIF.
SELECT SINGLE * FROM mara WHERE matnr = itab1-matnr.
IF sy-subrc NE 0.
CONTINUE.
ENDIF.
PERFORM view_routine.
PERFORM bdc_dynpro USING 'SAPLMGMM' '0060'.
PERFORM bdc_field USING 'BDC_CURSOR'
'RMMG1-MATNR'.
PERFORM bdc_field USING 'BDC_OKCODE'
'/00'.
PERFORM bdc_field USING 'RMMG1-MATNR'
itab1-matnr.
CONCATENATE 'MSICHTAUSW-DYTXT(' viewno ')' INTO wrk.
CONDENSE wrk NO-GAPS.
PERFORM bdc_dynpro USING 'SAPLMGMM' '0070'.
PERFORM bdc_field USING 'BDC_CURSOR'
wrk. "'MSICHTAUSW-DYTXT(11)'.
PERFORM bdc_field USING 'BDC_OKCODE'
'=ENTR'.
CONCATENATE 'MSICHTAUSW-KZSEL(' viewno ')' INTO wrk.
CONDENSE wrk NO-GAPS.
PERFORM bdc_field USING wrk "'MSICHTAUSW-KZSEL(11)'
'X'.
PERFORM bdc_dynpro USING 'SAPLMGMM' '0080'.
PERFORM bdc_field USING 'BDC_CURSOR'
'RMMG1-WERKS'.
PERFORM bdc_field USING 'BDC_OKCODE'
'=ENTR'.
PERFORM bdc_field USING 'RMMG1-WERKS'
itab1-werks.
PERFORM bdc_dynpro USING 'SAPLMGMM' '4000'.
PERFORM bdc_field USING 'BDC_OKCODE'
'=BU'.
* PERFORM bdc_field USING 'MAKT-MAKTX'
* '"HEX BOLT M16X1.5X100,B8.8,BP"'.
* PERFORM bdc_field USING 'MARA-MEINS'
* 'NOS'.
* PERFORM bdc_field USING 'MARC-DISGR'
* '701'.
* PERFORM bdc_field USING 'MARC-EKGRP'
* 'A00'.
PERFORM bdc_field USING 'BDC_CURSOR'
'MARC-DISPO'.
* PERFORM bdc_field USING 'MARC-DISMM'
* 'PD'.
PERFORM bdc_field USING 'MARC-DISPO'
itab1-dispo.
* PERFORM bdc_field USING 'MARC-DISLS'
* 'MB'.
CALL TRANSACTION 'MM02' USING bdc_data MODE mode UPDATE 'S'.
ENDLOOP.
ENDIF.
ENDFORM. " BDC_MRPCONTROLLER_CHANGE
*& Form bdc_dynpro
* text
* -->PROGRAM text
* -->DYNPRO text
FORM bdc_dynpro USING program dynpro.
CLEAR bdc_data.
bdc_data-program = program.
bdc_data-dynpro = dynpro.
bdc_data-dynbegin = 'X'.
APPEND bdc_data.
ENDFORM. "BDC_DYNPRO
* Insert field *
FORM bdc_field USING fnam fval.
CLEAR bdc_data.
bdc_data-fnam = fnam.
bdc_data-fval = fval.
APPEND bdc_data.
ENDFORM. "BDC_FIELD
*& Form VIEW_ROUTINE
* text
* --> p1 text
* <-- p2 text
FORM view_routine .
CLEAR viewno.
SELECT * FROM t133a INTO CORRESPONDING FIELDS OF TABLE i_t133a
WHERE bilds = '21' AND guifu LIKE 'SP%' .
LOOP AT i_t133a .
ch = i_t133a-pstat.
IF mara-vpsta NA ch .
DELETE i_t133a .
CONTINUE .
ENDIF .
ENDLOOP.
SORT i_t133a BY guifu ASCENDING .
LOOP AT i_t133a .
viewno = viewno + 1 .
IF i_t133a-guifu = guifu .
EXIT .
ENDIF .
ENDLOOP .
ENDFORM. " VIEW_ROUTINE
Regards, -
Calling another report by passing selection screen parameter
Hi,
I have created a report "ZREPA" with selection screen parameter say, "creator".
Nw, i hv to call that report "ZREPA" from another report say "ZREPB" by passing an value to the selection screen field "creator".
Can anyone tell me how to resolve this??
Thanks,
Aaru.Hi,
You can call one selection screen from other selection screen program using SUBMIT command.
The syntax is as follows -
codeSUBMIT... VIA SELECTION-SCREEN
USING SELECTION-SET <var>
WITH <sel> <criterion>
WITH FREE SELECTIONS <freesel>
WITH SELECTION-TABLE <rspar>.[/code]
e.g.
The following executable program (report) creates a selection screen containing the parameter PARAMET and the selection criterion SELECTO:
codeREPORT demo_program_submit_rep1.
DATA number TYPE i.
PARAMETERS paramet(14) TYPE c.
SELECT-OPTIONS selecto FOR number.[/code]
The program DEMO_PROGRAM_SUBMIT_REP1 is called by the following program using various parameters:
REPORT demo_program_submit_sel_screen NO STANDARD PAGE HEADING.
DATA: int TYPE i,
rspar TYPE TABLE OF rsparams,
wa_rspar LIKE LINE OF rspar.
RANGES seltab FOR int.
WRITE: 'Select a Selection!',
SKIP.
FORMAT HOTSPOT COLOR 5 INVERSE ON.
WRITE: 'Selection 1',
/ 'Selection 2'.
AT LINE-SELECTION.
CASE sy-lilli.
WHEN 4.
seltab-sign = 'I'. seltab-option = 'BT'.
seltab-low = 1. seltab-high = 5.
APPEND seltab.
SUBMIT demo_program_submit_rep1 VIA SELECTION-SCREEN
WITH paramet eq 'Selection 1'
WITH selecto IN seltab
WITH selecto ne 3
AND RETURN.
WHEN 5.
wa_rspar-selname = 'SELECTO'. wa_rspar-kind = 'S'.
wa_rspar-sign = 'E'. wa_rspar-option = 'BT'.
wa_rspar-low = 14. wa_rspar-high = 17.
APPEND wa_rspar TO rspar.
wa_rspar-selname = 'PARAMET'. wa_rspar-kind = 'P'.
wa_rspar-low = 'Selection 2'.
APPEND wa_rspar TO rspar.
wa_rspar-selname = 'SELECTO'. wa_rspar-kind = 'S'.
wa_rspar-sign = 'I'. wa_rspar-option = 'GT'.
wa_rspar-low = 10.
APPEND wa_rspar TO rspar.
SUBMIT demo_program_submit_rep1 VIA SELECTION-SCREEN
WITH SELECTION-TABLE rspar
AND RETURN.
ENDCASE.
=> To leave a called program, you can use SUBMIT .... AND RETURN. by choosing F3 or F15 from list level 0 of the called report.
Regards,
Omkaram. -
Problem in at selection-screen on value request
hi friends ,
i want to display f4 help for a field in a popup. this i can do, but this popup comes based on values
i entered in other screen fields . but these values are not updated to screen values when i trigger f4.Hi,
DATA: T_DYNPRO TYPE TABLE OF DYNPREAD,
WA_DYNPRO LIKE LINE OF T_DYNPRO,
AT SELECTION-SCREEN ON VALUE-REQUEST FOR P_PARAM.
WA_DYNPRO-FIELDNAME = 'Screen Field Name'.
APPEND WA_DYNPRO TO T_DYNPRO.
CALL FUNCTION 'DYNP_VALUES_READ'
EXPORTING
DYNAME = SY-REPID
DYNUMB = SY-DYNNR
TRANSLATE_TO_UPPER = 'X'
TABLES
DYNPFIELDS = T_DYNPRO
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 <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
READ TABLE T_DYNPRO INTO WA_DYNPRO WITH KEY FIELDNAME = 'Screen Field Name'.
TEMP = WA_DYNPRO-FIELDVALUE.
" Select the values based on Temp and populate your internal table for F4 help using the Screen value Temp
"Call 'F4IF_INT_TABLE_VALUE_REQUEST' and display the pop up. -
Problem with Hiding fields of selection screen which is called as subscreen
Hello All,
I have problem while hiding the selection screen which is called as subscreen.
Flow of my logic:
Selection-screen with one field and three buttons CREATE,DISPLAY and CHANGE in application toolbar.
user enter some value in field and either he press change or dispaly
When change i need to call selection screen when it is in dispaly i need to stop calling this selection screen.
Upto my knowledge we can't stop calling selection screen in display mode so there is only one possibility is hiding the fields when it is in display mode.
How can i hide the fields and where i need to hide fields?
Please post some codes.
Regards,
Lisayou can refer the sample code which i mentioned in your previous post. that will solve the problem.
-
can any one suggest, how to capture the selection screen value on the selection screen itself.
ex : i have parameter (plant) on the selection screen, based on the plant entered by user i need to display the F4 help for the another parameter(MRP controller).
if the user enters plant 3218 then when requests for F4 help for the parameter MRP controller, then controller values related to that plant need to be displayed as F4 help.
i had done everything explaned above, but one problem i am facing.
after entering the plant on the selection screen i need to press the enter key, then if i request for F4 for MRP controller then i am getting the apprpriate values.
after entering plant if i didnot use enter key and request for F4 help for MRP controller then it is displaying no values.Hello Sippy
The ENTER causes the program flow to pass PAI followed by PBO of the selection-screen. This way the entered value becomes "known" to the report.
If you enter your plant, do NOT push ENTER and then call the next search help you have to read the entered value from the selection-screen yourself using fm DYNP_VALUES_READ.
For more details search the forums for this function module, e.g.:
[Regarding Custom F4 help|Regarding Custom F4 help;
Regards
Uwe
Maybe you are looking for
-
Is it possible to measure single voltages without creating a new task every time
I need to take voltages as input in the event loop of a program. If I create a task, take a measurement, then stop the task I get roughly 10 - 20 measurements a second. Is this the most efficient way to do this, I would need many more measurements, b
-
why is the map not displaying correctly on "find my phone" on my computer. I am getting large grid squares on the map. I have tried deleting my history, tried zooming in & out, but the grid squares won't go away..
-
Access Connection​s refuses to run - X200 XP
Either something changed (an update?) or something I inadvertently did that has caused Access Connections to no longer run. The wireless connection is working fine and all of the Fn - x buttons work fine and I am not aware of any other issues with my
-
Posting Webpage created in iPhoto to .mac site
I have "exported" an album using the file/export/webpage commands. In the new folder I created on the desktop, It created folders with all the images, thumbnails and pages in them, along with "Pages.html" documents for the main page, and the thirteen
-
Problems with loading flash content in firefox, chrome, and opera
Salutations. The past couple of days, I've been having trouble with loading flash content on many sites. In particular, many flash games on sites like facebook will not load for me. Sporadically on other sites, flash content will not load, either.