‎2013 Jun 27 10:19 AM
Hi experts,
how can I read url-parameters in a View of a BSP-Application.
In a bsp-web page I can set the page attributes with column "auto".
However in a view I don't have this column available in "page attributes".
How can I read url parameters now?
thx a lot
‎2013 Jun 28 2:46 PM
‎2013 Jun 27 11:15 AM
CALL METHOD cl_bsp_runtime => if_bsp_runtime ~ construct_bsp_url
EXPORTING
in_protocol = 'http'
in_application = 'sxidemo_agcy_ui'
in_page = 'main.htm'
IMPORTING
out_abs_url = lv_page_url.
‎2013 Jun 27 11:58 AM
Hi Premprkash,
could you please explain again, how this should work?
Do I've to call this method as you described?
Because in that case I only get a prepaired url, but not the values of the url.
kind regards
‎2013 Jun 27 11:24 AM
Hi,
The BSP runtime fills a two-column internal table, in which the name/value pairs of the
query string are stored. The name of this internal table is FORM_FIELDS. So Read that internal table for required field in DO_HANDLE_DATA method of view. The user entries are stored unformatted in the internal table FORM_FIELDS. Any required conversion to the internal format must be
programmed (for example, for a date, user input would be 13/12/2003;
internal format would be 20031213).
Regards,
Sreenivas.
‎2013 Jun 27 11:54 AM
Hi Sreenivas,
thx a lot for reply.
But how can I access this table?
Where do I find the "DO_HANDLE_DATA" Method?
Thx
‎2013 Jun 27 12:39 PM
Hi,
In controller of view you can find that method.
here is sample code
METHOD do_handle_data.
DATA :
wlt_form_fields TYPE tihttpnvp,
wls_form_fields TYPE ihttpnvp.
FREE :
wlt_form_fields.
* récupération des variables envoyées
wlt_form_fields = form_fields.
SORT wlt_form_fields BY name.
* mapping de ces variables dans les attributs de la classe
CLEAR :
wls_form_fields.
READ TABLE wlt_form_fields INTO wls_form_fields
WITH KEY name = 'entered_name'
BINARY SEARCH.
MOVE wls_form_fields-value TO me->entered_name.
ENDMETHOD.
Regards,
sreenivas.
‎2013 Jun 27 3:05 PM
Hi screenivas,
I am sorry, but I don't have this method in my controller.
I only have the following:
DO_CONFIG_DETERMINATION
SET_VIEW_GROUP_CONTEXT
DO_PREPARE_OUTPUT
DO_VALIDATE_INPUT
DO_FINISH_INPUT
These are the methods I see in bsp_wd_cmpwb on my enhanced component (AIC_INCIDENT_H).
Any ideas?
‎2013 Jun 27 12:00 PM
Check This
REPORT z_mm_material_details.
TYPE-POOLS: icon.
*----------------------------------------------------------------------*
* Database Tables
*----------------------------------------------------------------------*
TABLES: mara, " Material master
marc, " Storage Location Data for Material
mbew, " Material Valuation
tvko, " Organizational Unit: Sales Organizations
t001w. " Plants/Branches
*----------------------------------------------------------------------*
* Internal Tables
*----------------------------------------------------------------------*
DATA: BEGIN OF it_output OCCURS 10,
symbol LIKE icon-id,
mbrsh LIKE mara-mbrsh, " Industry sector
mtart LIKE mara-mtart, " Material Type
matnr LIKE mara-matnr, " Material Number
werks LIKE marc-werks, " Plant
maktx_en LIKE makt-maktx, " Material Description(english)
meins LIKE mara-meins, " Unit
bismt LIKE mara-bismt, " Old Material Number
matkl LIKE mara-matkl, " Material Group
wgbez LIKE t023t-wgbez, " Material Group Desc.
normt LIKE mara-normt, " Industry std. desc.
wrkst LIKE mara-wrkst, " Basic material
ferth LIKE mara-ferth, " Production/inspection memo
spart LIKE mara-spart, " Division
mtpos_mara LIKE mara-mtpos_mara," Gen. item cat. group
brgew LIKE mara-brgew, " Gross Weight
ntgew LIKE mara-ntgew, " Net Weight
gewei LIKE mara-gewei, " Weight Unit
sal_ind(1), " Sales relevant indicator
ekgrp LIKE marc-ekgrp, " Purchasing Group
taxim LIKE mlan-taxim, " Tax ind. for mat. (purchasing)
dismm LIKE marc-dismm, " Mrp_type
dispo LIKE marc-dispo, " Mrp_controller
disls LIKE marc-disls, " Lot_size
beskz LIKE marc-beskz, " Procurement_type
lgfsb LIKE marc-lgfsb, " Storage loc. for external proc
lgpro LIKE marc-lgpro, " Production_storage_location
fevor LIKE marc-fevor, " Production Supervisor
sfcpf LIKE marc-sfcpf, " Production Scheduling profile
dzeit LIKE marc-dzeit, " In_house_production_time
plifz LIKE marc-plifz, " Planned_delivery_timeindays
fhori LIKE marc-fhori, " Scheduling_margin_key
sbdkz LIKE marc-sbdkz, " Dep_reqs_indi_coll_reqmts
bklas LIKE mbew-bklas, " Valuation Class
vprsv LIKE mbew-vprsv, " Price control indicator
peinh LIKE mbew-peinh, " Price Unit
incoming_ind(1), " Incoming Inspection
vendor_ind(1), " Vendor Inspection
outbound_ind(1), " Outbound Inspection
selkz(1),
END OF it_output.
DATA: BEGIN OF it_marc OCCURS 10,
matnr LIKE marc-matnr, " Material Number
werks LIKE marc-werks, " Plant
ekgrp LIKE marc-ekgrp, " Purchasing group
dismm LIKE marc-dismm, " Mrp_type
dispo LIKE marc-dispo, " Mrp_controller
disls LIKE marc-disls, " Lot_size
beskz LIKE marc-beskz, " Procurement_type
lgfsb LIKE marc-lgfsb, " Storage loc. for external proc
lgpro LIKE marc-lgpro, " Production_storage_location
fevor LIKE marc-fevor, " Production Supervisor
sfcpf LIKE marc-sfcpf, " Production Scheduling profile
dzeit LIKE marc-dzeit, " In_house_production_time
plifz LIKE marc-plifz, " Planned_delivery_timeindays
fhori LIKE marc-fhori, " Scheduling_margin_key
sbdkz LIKE marc-sbdkz, " Dep_reqs_indi_coll_reqmts
END OF it_marc.
DATA: BEGIN OF it_mara OCCURS 10,
mbrsh LIKE mara-mbrsh, " Industry sector
mtart LIKE mara-mtart, " Material Type
matnr LIKE mara-matnr, " Material Number
meins LIKE mara-meins, " Unit
bismt LIKE mara-bismt, " Old Material Number
matkl LIKE mara-matkl, " Material Group
spart LIKE mara-spart, " Division
mtpos_mara LIKE mara-mtpos_mara, " Gen. item cat. group
brgew LIKE mara-brgew, " Gross Weight
ntgew LIKE mara-ntgew, " Net Weight
gewei LIKE mara-gewei, " Weight Unit
normt LIKE mara-normt,
wrkst LIKE mara-wrkst,
ferth LIKE mara-ferth,
END OF it_mara.
DATA: BEGIN OF it_mbew OCCURS 10,
matnr LIKE mbew-matnr,
bklas LIKE mbew-bklas, " Valuation Class
vprsv LIKE mbew-vprsv, " Price control indicator
peinh LIKE mbew-peinh, " Price Unit
END OF it_mbew.
DATA: BEGIN OF it_makt OCCURS 10,
matnr LIKE makt-matnr,
spras LIKE makt-spras,
maktx LIKE makt-maktx,
END OF it_makt.
DATA: BEGIN OF it_t001w OCCURS 10,
werks LIKE t001w-werks,
bwkey LIKE t001w-bwkey,
land1 LIKE t001w-land1,
END OF it_t001w.
DATA wa_t001w LIKE it_t001w.
DATA: BEGIN OF it_mlan OCCURS 10,
matnr LIKE mlan-matnr,
aland LIKE mlan-aland,
taxim LIKE mlan-taxim,
END OF it_mlan.
DATA: BEGIN OF it_mvke OCCURS 10,
matnr LIKE mvke-matnr, "Material Number
vkorg LIKE mvke-vkorg, "Sales_organization
vtweg LIKE mvke-vtweg, "Distribution_channel
dwerk LIKE mvke-dwerk, "Delivering_plant
ktgrm LIKE mvke-ktgrm, "Acct_assign_group_for_material
mtpos LIKE mvke-mtpos, "Item_category_group
END OF it_mvke.
DATA: BEGIN OF it_qmat OCCURS 10,
art LIKE qmat-art,
matnr LIKE qmat-matnr,
werks LIKE qmat-werks,
aktiv LIKE qmat-aktiv,
END OF it_qmat.
DATA: BEGIN OF it_t023t OCCURS 10,
spras LIKE t023t-spras,
matkl LIKE t023t-matkl,
wgbez LIKE t023t-wgbez,
END OF it_t023t.
*----------------------------------------------------------------------*
* Variables
*----------------------------------------------------------------------*
DATA: gd_maktx LIKE makt-maktx,
gd_pf_status(30),
gd_user_command(30),
gd_internaltable(30),
gd_mvke TYPE mvke,
gd_land1 TYPE t001w-land1.
*----------------------------------------------------------------------*
* ALV GRID Variables
*----------------------------------------------------------------------*
TYPE-POOLS: slis.
DATA: gd_title TYPE lvc_title,
gd_fieldcat TYPE slis_t_fieldcat_alv ,
wa_fieldcat TYPE slis_fieldcat_alv,
gd_layout TYPE slis_layout_alv,
gd_sort TYPE slis_t_sortinfo_alv,
wa_sort LIKE LINE OF gd_sort,
gd_events TYPE slis_t_event,
gd_extab TYPE slis_t_extab WITH HEADER LINE,
gd_event_exit TYPE slis_t_event_exit WITH HEADER LINE,
wa_event TYPE slis_alv_event,
wa_event_exit TYPE slis_t_event_exit,
gd_save(1),
gd_repid LIKE sy-repid,
gd_dynnr LIKE sy-dynnr,
gd_param1 LIKE sy-ucomm,
gd_top TYPE slis_t_listheader,
wa_top TYPE slis_listheader.
*----------------------------------------------------------------------*
* Selection Screen
*----------------------------------------------------------------------*
SELECTION-SCREEN BEGIN OF BLOCK b1 WITH FRAME TITLE text-001.
PARAMETER: s_werks LIKE marc-werks OBLIGATORY.
SELECT-OPTIONS: s_matnr FOR mara-matnr,
s_mtart FOR mara-mtart.
SELECTION-SCREEN END OF BLOCK b1.
*----------------------------------------------------------------------*
* Main Program
*----------------------------------------------------------------------*
START-OF-SELECTION.
* authority-check object 'M_MATE_WRK'
* id 'ACTVT' field '03'
* id 'WERKS' field s_werks.
* if sy-subrc ne 0.
* MESSAGE s208(1b) WITH text-013.
* exit.
* endif.
gd_repid = sy-repid.
gd_save = 'A'.
PERFORM fetch_data.
IF it_output[] IS NOT INITIAL.
gd_internaltable = 'IT_OUTPUT'.
gd_pf_status = 'PF_STATUS'.
gd_user_command = 'USER_COMMAND'.
PERFORM display_details TABLES it_output.
ELSE.
MESSAGE i429(mo).
"No table entries found for specified key
ENDIF.
*&---------------------------------------------------------------------*
*& Form FETCH_DATA
*&---------------------------------------------------------------------*
* text
*----------------------------------------------------------------------*
* --> p1 text
* <-- p2 text
*----------------------------------------------------------------------*
FORM fetch_data .
CLEAR: it_mara,
it_mara[],
it_marc,
it_marc[],
it_mbew,
it_mbew[],
it_mvke,
it_mvke[],
it_qmat,
it_qmat[].
* Select Material Plant wise Details
SELECT matnr
werks
ekgrp
dismm
dispo
disls
beskz
lgfsb
lgpro
fevor
sfcpf
dzeit
plifz
fhori
sbdkz
FROM marc
INTO TABLE it_marc
WHERE matnr IN s_matnr
AND werks EQ s_werks.
IF it_marc[] IS NOT INITIAL.
* Select Material Type wise Details
SELECT mbrsh
mtart
matnr
meins
bismt
matkl
spart
mtpos_mara
brgew
ntgew
gewei
normt
wrkst
ferth
FROM mara
INTO TABLE it_mara
FOR ALL ENTRIES IN it_marc
WHERE matnr EQ it_marc-matnr
AND mtart IN s_mtart.
SELECT SINGLE werks bwkey land1 FROM t001w
INTO wa_t001w
WHERE werks EQ s_werks.
* Select Material Valuation Details
IF NOT wa_t001w-bwkey IS INITIAL.
SELECT matnr
bklas
vprsv
peinh FROM mbew
INTO TABLE it_mbew
FOR ALL ENTRIES IN it_marc
WHERE matnr EQ it_marc-matnr
AND bwkey EQ wa_t001w-bwkey.
ENDIF. "IF NOT WA_T001W-BWKEY IS INITIAL .
* Select Tax Indiactor
SELECT matnr
aland
taxim FROM mlan
INTO TABLE it_mlan
FOR ALL ENTRIES IN it_marc
WHERE matnr EQ it_marc-matnr.
* Inspection type - material parameters
SELECT art
matnr
werks
aktiv
FROM qmat
INTO TABLE it_qmat
FOR ALL ENTRIES IN it_marc
WHERE matnr EQ it_marc-matnr
AND werks EQ it_marc-werks.
ENDIF. " IF it_marc[] IS NOT INITIAL.
IF it_mara[] IS NOT INITIAL.
SELECT matnr
spras
maktx FROM makt
INTO TABLE it_makt
FOR ALL ENTRIES IN it_mara
WHERE matnr EQ it_mara-matnr
AND spras EQ sy-langu.
*Sales Data for Material
DATA: lv_vkorg LIKE tvko-vkorg.
CLEAR: lv_vkorg.
SELECT SINGLE vkorg FROM tvko
INTO lv_vkorg
WHERE werks EQ s_werks.
IF sy-subrc EQ 0.
SELECT matnr
vkorg
vtweg
dwerk
ktgrm
mtpos
FROM mvke
INTO TABLE it_mvke
FOR ALL ENTRIES IN it_mara
WHERE matnr EQ it_mara-matnr
AND vkorg EQ lv_vkorg.
ENDIF. "IF sy-subrc EQ 0 SELECT SINGLE vkorg FROM tvko.
SELECT spras
matkl
wgbez
FROM t023t
INTO TABLE it_t023t
FOR ALL ENTRIES IN it_mara
WHERE matkl EQ it_mara-matkl
AND spras EQ 'E'.
ENDIF. " IF it_mara[] IS NOT INITIAL.
*ENDIF. "IF it_marc[] IS NOT INITIAL.
CLEAR: it_output,
it_output[].
SORT it_marc BY matnr.
SORT it_makt BY matnr.
SORT it_mbew BY matnr.
SORT it_t001w BY werks.
SORT it_mlan BY matnr aland.
LOOP AT it_mara.
CLEAR:gd_maktx,
gd_land1,
gd_mvke.
it_output-mbrsh = it_mara-mbrsh. " Industry sector
it_output-mtart = it_mara-mtart. " Material Type
it_output-matnr = it_mara-matnr. " Material Number
it_output-meins = it_mara-meins. " Unit
it_output-bismt = it_mara-bismt . " Old Material Number
it_output-matkl = it_mara-matkl. " Material Group
it_output-spart = it_mara-spart. " Division
it_output-mtpos_mara = it_mara-mtpos_mara." Gen. item cat.
it_output-brgew = it_mara-brgew. " Gross Weight
it_output-ntgew = it_mara-ntgew. " Net Weight
it_output-gewei = it_mara-gewei. " Weight Unit
it_output-normt = it_mara-normt. " Industry Std. Desc.
it_output-wrkst = it_mara-wrkst. " Basic Material
it_output-ferth = it_mara-ferth. " Prod./Insp. Memo
it_output-symbol = '@10@'.
READ TABLE it_marc WITH KEY matnr = it_mara-matnr BINARY SEARCH.
IF sy-subrc EQ 0.
it_output-werks = it_marc-werks. " Plant
it_output-ekgrp = it_marc-ekgrp. " Purchasing Group
it_output-dismm = it_marc-dismm. " Mrp_type
it_output-dispo = it_marc-dispo. " Mrp_controller
it_output-disls = it_marc-disls. " Lot_size
it_output-beskz = it_marc-beskz. " Procurement_type
it_output-lgfsb = it_marc-lgfsb. " Storage loc. for external proc
it_output-lgpro = it_marc-lgpro. " Production_storage_location
it_output-fevor = it_marc-fevor. " Production Supervisor
it_output-sfcpf = it_marc-sfcpf. " Production Scheduling profile
it_output-dzeit = it_marc-dzeit. " In_house_production_time
it_output-plifz = it_marc-plifz. " Planned_delivery_timeindays
it_output-fhori = it_marc-fhori. " Scheduling_margin_key
it_output-sbdkz = it_marc-sbdkz. " Dep_reqs_indi_coll_reqmts
ENDIF. "IF sy-subrc EQ 0.
LOOP AT it_makt WHERE matnr = it_mara-matnr.
it_output-maktx_en = it_makt-maktx.
ENDLOOP. "LOOP AT it_makt WHERE matnr = it_mara-matnr.
READ TABLE it_mbew WITH KEY matnr = it_mara-matnr BINARY SEARCH.
IF sy-subrc EQ 0.
it_output-bklas = it_mbew-bklas. " Valuation Class
it_output-vprsv = it_mbew-vprsv. " Price control indicator
it_output-peinh = it_mbew-peinh. " Price Unit
ENDIF. "IF sy-subrc EQ 0.
gd_land1 = wa_t001w-land1.
IF gd_land1 IS NOT INITIAL.
READ TABLE it_mlan WITH KEY matnr = it_output-matnr
aland = gd_land1 BINARY SEARCH.
IF sy-subrc EQ 0.
it_output-taxim = it_mlan-taxim.
ENDIF. " IF sy-subrc EQ 0.
ENDIF.
* If Sales Data for Material exists then mark the flag for sales
* relevant as 'X'.
READ TABLE it_mvke WITH KEY matnr = it_mara-matnr.
IF sy-subrc EQ 0.
IF it_mvke-vkorg IS NOT INITIAL .
it_output-sal_ind = 'X'.
ELSE.
CLEAR it_output-sal_ind.
ENDIF. "IF it_mvke-vkorg IS NOT INITIAL OR...
ENDIF. "IF sy-subrc EQ 0 READ TABLE it_mvke.
CLEAR: it_output-incoming_ind,
it_output-vendor_ind,
it_output-outbound_ind.
LOOP AT it_qmat WHERE matnr EQ it_mara-matnr.
* If the inspection type is 01 then incoming inspection flag is set
* to 'X'.
IF it_qmat-art EQ '01' AND it_qmat-aktiv EQ 'X'.
it_output-incoming_ind = 'X'.
* If the inspection type is 0101 then vendor inspection flag is set
* to 'X'.
ELSEIF it_qmat-art EQ '0101'AND it_qmat-aktiv EQ 'X'.
it_output-vendor_ind = 'X'.
* If the inspection type is 10 then outbound inspection flag is set
* to 'X'.
ELSEIF it_qmat-art EQ '10' AND it_qmat-aktiv EQ 'X'.
it_output-outbound_ind = 'X'.
ENDIF. "IF it_qmat-art EQ '01' AND it_qmat-aktiv EQ 'X'.
ENDLOOP. "LOOP AT it_qmat WHERE matnr EQ it_mara-matnr.
READ TABLE it_t023t WITH KEY matkl = it_mara-matkl.
IF sy-subrc EQ 0.
it_output-wgbez = it_t023t-wgbez.
ENDIF. "IF sy-subrc EQ 0 READ TABLE it_t023t.
APPEND it_output.
CLEAR : it_output.
ENDLOOP. " LOOP AT it_mara.
ENDFORM. " FETCH_DATA
*&---------------------------------------------------------------------*
*& Form DISPLAY_DETAILS
*&---------------------------------------------------------------------*
* text
*----------------------------------------------------------------------*
* -->P_IT_OUTPUT text
*----------------------------------------------------------------------*
FORM display_details TABLES gd_tables.
CLEAR: gd_fieldcat[],
gd_layout.
CALL FUNCTION 'REUSE_ALV_FIELDCATALOG_MERGE'
EXPORTING
i_program_name = gd_repid
i_internal_tabname = gd_internaltable
i_inclname = gd_repid
CHANGING
ct_fieldcat = gd_fieldcat.
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 sy-subrc <> 0.
PERFORM manipulate_fieldcat.
PERFORM manipulate_layout.
CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
EXPORTING
i_callback_program = gd_repid
* i_grid_title = gd_title
* i_callback_pf_status_set = gd_pf_status
i_callback_user_command = gd_user_command
* i_callback_top_of_page = 'TOP-OF-PAGE'
is_layout = gd_layout
it_fieldcat = gd_fieldcat
* i_screen_start_column = gd_start_col
* i_screen_start_line = gd_start_line
* i_screen_end_column = gd_end_col
* i_screen_end_line = gd_end_line
i_save = gd_save
* IMPORTING
* es_exit_caused_by_user = es_exit_caused_by_user
TABLES
t_outtab = gd_tables.
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 sy-subrc <> 0.
ENDFORM. " DISPLAY_DETAILS
*&---------------------------------------------------------------------*
*& Form MANIPULATE_FIELDCAT
*&---------------------------------------------------------------------*
* text
*----------------------------------------------------------------------*
* --> p1 text
* <-- p2 text
*----------------------------------------------------------------------*
FORM manipulate_fieldcat .
LOOP AT gd_fieldcat INTO wa_fieldcat.
CASE wa_fieldcat-fieldname.
WHEN 'MATNR'.
wa_fieldcat-hotspot = 'X'.
WHEN 'SAL_IND'.
wa_fieldcat-seltext_l = text-003. " Sales relevant
wa_fieldcat-ddictxt = 'L'.
WHEN 'TAXIM'.
wa_fieldcat-seltext_l = text-004. " Sales relevant
wa_fieldcat-ddictxt = 'L'.
WHEN 'INCOMING_IND'.
wa_fieldcat-seltext_l = text-005. " Incoming Inspection
wa_fieldcat-ddictxt = 'L'.
WHEN 'VENDOR_IND'.
wa_fieldcat-seltext_l = text-006. " Vendor Inspection
wa_fieldcat-ddictxt = 'L'.
WHEN 'OUTBOUND_IND'.
wa_fieldcat-seltext_l = text-007. " Outbound Inspection
wa_fieldcat-ddictxt = 'L'.
WHEN 'MAKTX_EN'.
wa_fieldcat-seltext_l = text-012." Material Description(English)
wa_fieldcat-ddictxt = 'L'.
WHEN 'SELKZ'.
wa_fieldcat-no_out = 'X'.
WHEN 'BISMT'.
wa_fieldcat-no_out = 'X'.
wa_fieldcat-tech = 'X'.
WHEN 'SYMBOL'.
wa_fieldcat-hotspot = 'X'.
wa_fieldcat-seltext_l = text-014.
wa_fieldcat-ddictxt = 'L'.
ENDCASE.
MODIFY gd_fieldcat FROM wa_fieldcat.
ENDLOOP. " LOOP AT gd_fieldcat INTO wa_fieldcat.
ENDFORM. " MANIPULATE_FIELDCAT
*&---------------------------------------------------------------------*
*& Form MANIPULATE_LAYOUT
*&---------------------------------------------------------------------*
* text
*----------------------------------------------------------------------*
* --> p1 text
* <-- p2 text
*----------------------------------------------------------------------*
FORM manipulate_layout .
gd_layout-colwidth_optimize = 'X'.
gd_layout-box_fieldname = 'SELKZ'.
gd_layout-box_tabname = 'IT_OUTPUT'.
ENDFORM. " MANIPULATE_LAYOUT
*&---------------------------------------------------------------------*
*& Form user_command
*&---------------------------------------------------------------------*
* text
*----------------------------------------------------------------------*
* -->PARAM1 text
* -->PARAM2 text
*----------------------------------------------------------------------*
FORM user_command USING param1 LIKE sy-ucomm
param2 TYPE slis_selfield.
DATA: wa_srgbtbrel TYPE srgbtbrel.
DATA: gd_doc_id LIKE sofolenti1-doc_id,
it_content LIKE STANDARD TABLE OF solisti1 WITH HEADER LINE.
CLEAR:it_content,
it_content[],
gd_doc_id ,
wa_srgbtbrel.
CASE param1.
WHEN '&IC1'.
CHECK: param2-value IS NOT INITIAL.
CASE param2-fieldname.
WHEN 'MATNR'.
READ TABLE it_output INDEX param2-tabindex.
IF sy-subrc EQ 0.
SET PARAMETER ID 'MAT' FIELD it_output-matnr.
CALL TRANSACTION 'MM03' AND SKIP FIRST SCREEN.
ENDIF. " IF sy-subrc EQ 0.
WHEN 'SYMBOL'.
READ TABLE it_output INDEX param2-tabindex.
IF sy-subrc EQ 0.
* Select URL for the image
SELECT SINGLE * FROM srgbtbrel
INTO wa_srgbtbrel
WHERE reltype EQ 'URL'
AND instid_a EQ it_output-matnr.
IF wa_srgbtbrel IS NOT INITIAL.
gd_doc_id = wa_srgbtbrel-instid_b.
CALL FUNCTION 'SO_DOCUMENT_READ_API1'
EXPORTING
document_id = gd_doc_id
* FILTER = 'X '
* IMPORTING
* DOCUMENT_DATA =
TABLES
* OBJECT_HEADER =
object_content = it_content
* OBJECT_PARA =
* OBJECT_PARB =
* ATTACHMENT_LIST =
* RECEIVER_LIST =
* CONTENTS_HEX =
* EXCEPTIONS
* DOCUMENT_ID_NOT_EXIST = 1
* OPERATION_NO_AUTHORIZATION = 2
* X_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.
IF it_content[] IS NOT INITIAL.
READ TABLE it_content INDEX 1.
IF sy-subrc EQ 0.
REPLACE ALL OCCURRENCES OF '&KEY&' IN it_content WITH ' '.
CALL FUNCTION 'GUI_RUN'
EXPORTING
command = it_content-line
parameter = it_content-line
* CD =
* IMPORTING
* RETURNCODE =
.
ENDIF.
ENDIF.
ELSE.
MESSAGE e378(69).
* No file found
ENDIF. " IF wa_srgbtbrel IS NOT INITIAL.
ENDIF. " IF sy-subrc EQ 0.
ENDCASE. "CASE param1.
ENDCASE. "CASE param1.
param2-refresh = 'X'.
ENDFORM. "user_command
‎2013 Jun 27 12:26 PM
‎2013 Jun 27 1:25 PM
‎2013 Jun 27 1:47 PM
one good standard page is session_test.htm in system BSP application
‎2013 Jun 28 6:09 AM
And can I see therein how to read url-parameters?
If yes, in which page?
thx
‎2013 Jun 28 7:15 AM
you just check bsp application which given and put break point clear all doubt.
‎2013 Jun 28 9:09 AM
Yes, but I doubt that there is any coding in there which shows how to read parameter-values of an url during an view (not bsp!)
‎2013 Jun 28 2:46 PM
‎2013 Jul 01 9:42 AM
‎2013 Jul 01 9:44 AM
‎2013 Jul 01 11:30 AM
Yes, but this don't works.
As I've already written, I don't have the "auto" option in page attributes.
therefore I can't get the parameter-values automatically.
‎2013 Jul 01 2:27 PM
Hi experts,
now I solved the problem.
With the runtime-object you can read all url parameters.
Do the following command:
(The Table lt_HTTPNVP) has to be defined)!
runtime->server->request->GET_FORM_FIELDS( CHANGING FIELDS = lt_HTTPNVP ).
‎2013 Jul 01 11:49 AM