/ISDFPS/CL_FBIMP_BADI_ME_ROUTE - Class for BAdI: /ISDFPS/BADI_ME_ROUTE

BAL_S_LOG - Application Log: Log header data   CPI1466 during Backup  
This documentation is copyright by SAP AG.

Functionality

Selecting routes

Parameters

Return parameter ROUTES: The parameter is filled with the selected routes, which are then transferred to the mobile device.

Example

METHOD /isdfps/if_badi_me_route~getroutedata.

DATA: ls_routes type /ISDFPS/MM_ME_ROUTE,

lt_tvro TYPE TABLE OF tvro,

lt_tvrot TYPE TABLE OF tvrot,

lt_languages TYPE TABLE OF /isdfps/me_cross_languages,

l_count TYPE sydbcnt,

cl_msg TYPE REF TO /isdfps/me_ca_msg.

FIELD-SYMBOLS: <fs_tvro> TYPE tvro.

FIELD-SYMBOLS: <fs_tvrot> TYPE tvrot.

FIELD-SYMBOLS: <languages> TYPE /isdfps/me_cross_languages.

* Get all mobile-relevant languages (they can be set in Customizing):

CALL FUNCTION '/ISDFPS/ME_CROSS_GET_SPRAS'

TABLES

languages = lt_languages.

* Read all routes from database

SELECT * FROM tvro INTO TABLE lt_tvro.

* Read the descriptions for all routes in the mobile relevant languages

SELECT * FROM tvrot INTO TABLE lt_tvrot

FOR ALL ENTRIES IN lt_languages

WHERE spras = lt_languages-spras1.

* Loop through all routes

LOOP AT lt_tvro ASSIGNING <fs_tvro>.

CLEAR: ls_routes.

MOVE-CORRESPONDING <fs_tvro> TO ls_routes.

* Loop through all languages for current route

LOOP AT lt_languages ASSIGNING <languages>.

ls_routes-laiso = <languages>-spras2.

READ TABLE lt_tvrot ASSIGNING <fs_tvrot>

WITH KEY route = <fs_tvro>-route

spras = <languages>-spras1.

IF sy-subrc NE 0 OR <fs_tvrot>-bezei IS INITIAL.

ls_routes-routbez = <fs_tvro>-route.

ELSE.

ls_routes-routbez = <fs_tvrot>-bezei.

ENDIF.

* Write route and description in current language into output table

APPEND ls_routes to routes.

ENDLOOP.

ENDLOOP.

ENDMETHOD.

Notes

In the example, you can use the "ISDFPS/ME_CROSS_GET_SPRAS" function module to read all languages thatare relevant for the mobile device. You should set these languages in Customizing under "Specify LanguagesAvailable When Mobilized". Now, all routes in the system are read from table TVRO and the route descriptionsin the selected language are read from table TVROT. This data is copied to the return parameter "ROUTES"and transferred to the program that is calling it. This example corresponds to the fallback class. It is executed if no other implementation has been created.



General Material Data   General Material Data  
This documentation is copyright by SAP AG.


Length: 2847 Date: 20120526 Time: 060922     triton ( 121 ms )