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,
Lawrence
Hi 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?
Similar Messages
-
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.
HarshHi 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 -
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 -
While uploading data into the r/3 using call transaction or session method
hi experts
while uploading data into the r/3 using call transaction or session method error occured in the middle of the processing then how these methods behaves it transfers next records or not?hai
Session method: The records are not added to the database until the session is processed. sy-subrc is not returned. Error logs are created for error records. Updation in database table is always Synchronous.
Call Transaction method: The records are immediately added to the database table. sy-subrc is returned to 0 if successful. Error logs are not created and hence the errors need to be handled explicitly. Updation in database table is either Synchronous or Asynchronous.
While to transfer the data from the through if any errors occurs until the errors are the complete the data is not transfer to the SAP system.
the system compulsory shows the errors. that errors are stored into the error logs (Transaction is SM35).
so the session method should not return any value.
In call transaction method data is directly pass to the SAP system.
So its compulsory return the value.
Because of the call transaction is the function.
A function should return the value mandatory
In session method errors stroed in SYSTEM GENRATED ERROR LOG.
IN CALL TRANSACTION TO CAPTURE THE ERRORS WE SHOULD PERFORM THE FOLLOWING.
FIRST ME MUST DECLARE AN INTERNAL TABLE WITH THE STRUCTURE OF BDCMSGCOLL TABLE.
THEN WHILE WRITING THE CALL TRANSACTION STATEMENT WE SHOULD PUT THE 'E' MODE FOR CAPTURING ALL THE ERRORS.
THEN FINALLY THE CAPTURED ERRORS MUST TO SENT TO THE INTERNAL TABLE WHICH WE DECLARED IN THE BEGINNING WITH BDCMSGCOLL BY USING THE FUNCTION MODULE "FORMAT_MESSAGE"
AND THUS THE ERROR MESSAGES WILL BE SENT TO THE INTERNAL TABLE WHICH WE DECLARED AT THE BEGINNING. -
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 -
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 -
Drill down to all screens of XK03 in ALV report from CALL TRANSACTION
HI!
I have created a vendor master report which calls the XK03 transaction when the vendor is clicked on on the ALV output. It takes me to the XK03 address screen and when I try clicking to go to the next screen it says the last screen is reached , 'Do you wnat to cancell processing'. I want to enable the program to goto the next screens as well like the controll screen and the accounting screen ect in my drill down on call transaction.
following si my code section which does it.
CASE rs_selfield-fieldname.
WHEN 'LIFNR'.
* Set parameter ID for transaction screen field
CHECK NOT wa_vend-lifnr IS INITIAL.
SET PARAMETER ID 'LIF' FIELD wa_vend-lifnr.
SET PARAMETER ID 'BUK' FIELD wa_vend-bukrs.
SET PARAMETER ID 'EKO' FIELD wa_vend-ekorg.
SET PARAMETER ID 'KDY' FIELD kdy_val.
CALL TRANSACTION 'XK03' AND SKIP FIRST SCREEN. "EC needed
ENDCASE.
ENDCASE.
Thanks and regards,
AaravHi,
Your code seems to be right.
Try writing the code as the below format.
CASE SY-UCOMM.
* CHECK FUNCTION CODE
WHEN '&IC1'.
* CHECK FIELD CLICKED ON WITHIN ALVGRID REPORT
IF SELFIELD-FIELDNAME = 'LIFNR'.
* READ DATA TABLE, USING INDEX ROW USER CLICKED ON
READ TABLE IT_FINAL INTO WA_FINAL INDEX SELFIELD-TABINDEX.
* SET PARAMETER ID FOR TRANSACTION SCREEN FIELD
SET PARAMETER ID 'BES' FIELD WA_FINAL-LIFNR.
* EXECUTE TRANSACTION 'XK03',AND SKIP INITIAL DATA ENTRY SCREEN.
CALL TRANSACTION 'XK03' AND SKIP FIRST SCREEN.
ENDIF.
ENDCASE.
Thanks
Arbind -
Drop down box for the selection screen field of the classical report
Hi all.
i want to have the drop down list to choose from, for the region(table:zbwcntry-field:zregion1) on the selection screen.
what is to be added to the code for this requirement.Also,please note that this is the classical report.
thanks for this answered.hi,
data : gv_name TYPE vrm_id, " used for vrm id
gv_repid TYPE sy-repid, " used to hold program name
work area to provide drop down list
DATA : gs_value TYPE vrm_value,
Internal table to provide drop down list
DATA : gt_values TYPE vrm_values,
PARAMETER : p_run(12) TYPE c AS LISTBOX VISIBLE LENGTH 12
DEFAULT 'DEFAULT' OBLIGATORY,
CONSTANTS : gc_run(5) TYPE c VALUE 'P_RUN', "constant for run mode
gv_name = gc_run.
gs_value-key = gc_v1.
gs_value-text = text-010.
APPEND gs_value TO gt_values.
gs_value-key = gc_v2.
gs_value-text = text-011.
APPEND gs_value TO gt_values.
CALL FUNCTION 'VRM_SET_VALUES'
EXPORTING
id = gv_name
values = gt_values
EXCEPTIONS
id_illegal_name = 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.
Hope this is helpful.
Rgds.,
subash -
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 to pass select option value to function module while using service call
Hi,
I have select-option in my WD application. To collect data based on user input im using service call. How to pass this select option values to my RFC.
rgds
sudhanshuHi,
Thank s for your reply. In fact im doing similar with following variation:
i) collected range values using get_range* method.
ii) separate low and high values as:
read table <field2> index 1 into wa_range.
vert2_low = wa_range-low.
vert2_high = wa_range-high.
(Please note that in RFC I have taken two importing parameter as s_vert_lo and s_vert_hi)
iii) Now setting these RFC attribute as:
lo_el_importing->set_attribute(
EXPORTING
name = `S_VERT_LO`
value = vert2_low ).
and
lo_el_importing->set_attribute(
EXPORTING
name = `S_VERT_HI`
value = vert2_high ).
iv) In RFC im having my query as :
select <fld list> from BUT000 into table itab where vertical in r_vert.
Here, r_vert is a range defined as:
ranges r_vert for <fld refrence>
r_vert-sign = 'I'.
r_vert-option = 'BT'.
r_vert-low = S_VERT_LO.
r_vert-high = S_VERT_HI.
append r_vert.
Issue here is with ranges. if im passing both low and high values it is fine but if only low value being passed it is not giving me any record.
Please suggest.
Rgds
Sudhanshu -
Showing Selection screen Varible values on the workbook report
Hi,
I want to show values of selection screen variables on the workbook report.
Please help me on this.
Thanks,
Isiri.Hey All,
I'm also face the same problem.
IF i use the TEXT related with filter,the workbook become bigger.
In BEx analyzer 3.5 you had the possibility to remove query results from your workbook before saving it.
Any idea's how you can do this in the BI 7.0 Analyzer? -
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 -
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, -
Selection screen value display
can any one suggest, how to display the selection screen value in the output of the report
i am using SQ02 record processing...Hi,
In SQ02 -> Extras(F5)->Selections tab-->press
create icod there.
It will display pop-up screen .
Enter your selection paramenter name.
Ex: s_xxxx.
--->Select one of the radio buttons.
In extras tab create a field whci is of same type of your required output field.
Then go back to field groups(F6).
Left side under extras join you will find your varable which you have created .
Move that field to right side field groups(By drag and drop (OR ) field right click add to field group. )
Under START-OF -selection event
Move s_xxxx To v_xxxx
v_xxx is the field you have created in extras.
Activate the infoset.
In sq01->change mode->press F6--->Press F6
Now select the checkbox of your output field.
On sam,e screen > basic list>select check box of your field. Save -
How to pass value from the Z Report to the selection screen of the std rep
Dear Experts,
i have developed a report and the values are maintained only in internal table based on some condition. When I execute the report, for example MM60, there is a material number field for multiple selection.
the report should call the standard transaction and pass the values from the internal table to the multiple selection- material number of the standard transaction.
the standard transaction should never get executed automatically. Only the value should get passed from internal table to the standard t code. Please help.
regards,
ShankarHai
Go through the following Documents
SUBMIT rep.
Additions
1. ... LINE-SIZE col
2. ... LINE-COUNT lin
3. ... TO SAP-SPOOL
4. ... VIA SELECTION-SCREEN
5. ... AND RETURN
6. ... EXPORTING LIST TO MEMORY
7. ... USER user VIA JOB job NUMBER n
8. ... Various additions for parameter transfer to rep
9. ... USING SELECTION-SETS OF PROGRAM prog
Effect
Calls the report rep . Leaves the active program and starts the new report rep .
Addition 1
... LINE-SIZE col
Effect
Prints the report with the line width col .
Addition 2
... LINE-COUNT lin
Effect
Prints the report with lin lines (per page).
Addition 4
... VIA SELECTION-SCREEN
Effect
Displays the selection screen for the user. In this case, the selection screen is redisplayed after return from the report list display - the user's entries are retained.
Addition 5
... AND RETURN
Effect
Returns to the calling transaction or program after the called program has been executed. SUBMIT ... AND RETURN creates a new internal mode .
Addition 6
... EXPORTING LIST TO MEMORY
Effect
Does not display the output list of the called report, but saves it in SAP memory and leaves the called report immediately. Since the calling program can read the list from memory and process it further, you need to use the addition ... AND RETURN . Also, since the called report cannot be requested for printing, the addition ... TO SAP-SPOOL is not allowed here. You can read the saved list from SAP memory with the function module 'LIST_FROM_MEMORY' and then (for example) store it in the database with EXPORT . You can process this list further with the function modules 'WRITE_LIST' , 'DISPLAY_LIST' ... of the function group "SLST" .
Addition 7
... USER user VIA JOB job NUMBER n
Effect
Schedules the specified report in the job specified by the job name job and the job number n . The job runs under the user name user and you can omit the addition USER user . The assignment of the job number occurs via the function module JOB_OPEN (see also the documentation for the function modules JOB_CLOSE and JOB_SUBMIT . This addition can only be used with the addition ...AND RETURN .
Note
When scheduling a report with the SUBMIT ... VIA JOB job NUMBER n statement, you should always use the addition ...TO SAP-SPOOL to pass print and/or archive parameters. Otherwise, default values are used to generate the list and this disturbs operations in a production environment.
Addition 9
... USING SELECTION-SETS OF PROGRAM prog
Effect
Uses variants of the program prog when executing the program rep .
Note
Important
The programs prog and rep must have the same SELECT-OPTIONS and PARAMETER s. Otherwise, variants of the program prog may be destroyed.
Note
When using this addition, the specified variant vari of the program prog is taken in USING SELECTION-SET vari . On the other hand, all variant-related actions on the selection screen of rep (Get , Save as variant , Display , Delete ) refer to the variants of prog .
Example
SUBMIT REPORT01
VIA SELECTION-SCREEN
USING SELECTION-SET 'VARIANT1'
USING SELECTION-SETS OF PROGRAM 'REPORT00'
AND RETURN.
Effect
Executes the program REPORT01 with the variant VARIANT1 of the program REPORT00 .
Note
Runtime errors
LOAD_PROGRAM_NOT_FOUND : The specified program was not found.
SUBMIT_WRONG_TYPE : The specified program is not a report.
SUBMIT_IMPORT_ONLY_PARAMETER : Only one value passed to a report parameter.
SUBMIT_WRONG_SIGN : Invalid value passed to a selection with the addition SIGN .
SUBMIT_IN_ITAB_ILL_STRUCTURE : Table passed to a selection with WITH sel IN itab had an unexpected structure.
Try with this Example
Data: listobject like abaplist occurs 1 with header line.
CALL FUNCTION 'LIST_FROM_MEMORY'
TABLES
listobject = listobject
EXCEPTIONS
OTHERS = 1 .
IF sy-subrc <> 0.
message ID '61' TYPE 'E' NUMBER '731'
with 'LIST_FROM_MEMORY'.
ENDIF.
Thanks & regards
Sreenivasulu P
Maybe you are looking for
-
How to generate a sinewave with at-mio-16de
I have an at-mio-16de Daq card. I want to generate a sine wave on the analog o/p. I believe that I would use the WFM_load function. I do not understand 1) how to load a buffer for this function and 2) what mode I am supposed to use. The modes in the
-
ITunes requires a newer version of Apple Mobile Device Support?
I've uninstalled and reinstalled the newest version of iTunes and it still says it needs a newer version. I'm working with Windows 7 and I'm really having difficulties hooking up my iPhone 4 with iTunes. I've literally done everything. I've started a
-
After Effects Production Premium CS3 on Windows Vista. AE Worked great for about 10 Projects then on Export to Quick Time started crashing. 1. Question AE Export to QT Movie -(Default Settings) Crashes half way thru Export to QT get a Error 0 : : 4
-
Hi, How Is it possible for completing the MIRO (Invoice Verification) for the periods for which the MM Period is closed. (from April -August) My client has missed a lot of Invoice Verification Entries & has to update the Entries now but want to give
-
How to print 2 sided pages brochure
how to print 2 sided pages brochure