cancel
Showing results for 
Search instead for 
Did you mean: 

FM HRTRV_IF_GET_TRIP does not return USERDATA

Lukas_Weigelt
Active Contributor
0 Kudos

Hi, it's me, yet again...

I'm using the FM "HRTRV_IF_GET_TRIP" in FITE_VC_GENERA_DATA in a post exit of comp-controller method "ON_SHOW" to get the structure/Table USER/PTK99 from the TE Cluster for binding to the context afterwards. At least that's the plan. The FM does not return me the data I expect in parameter USERDATA, although there is data in the TE Cluster and within the FM, I can see the global Table USER being filled whilst the macro RP-IMP-C1-TE. But this data is not further process neither is seems the strucutre USERDATA to be touched at any point of the FM. Am I calling the FM 'wrong' in any way? I'm close to making an implicit enhancement at the end and forcefully fill userdata from user....

Too long, didn't read: USERDATA is not returned filled --> WHY?

CALL FUNCTION 'HRTRV_IF_GET_TRIP'
  EXPORTING
    employeenumber             = wd_assist->GS_COMMON_RFC_INPUT-employee_number
    tripnumber                 = lv_tripno
*   LANGUAGE                   = SY-LANGU
*   CALCULATE_AMOUNTS          = 'X'
*   GET_TRIP_FROM_MEMORY       = ' '
  IMPORTING
*   FRAMEDATA                  =
*   STATUS                     =
    USERDATA                   = ls_user " should contain cluster values, but it doesn't
  tables
*   RECEIPTS                   =
*   ADDINFO                    =
*   GUESTS                     =
*   TEXT                       =
*   MILEAGE                    =
*   STOPOVER                   =
*   DEDUCTIONS                 =
*   COSTDIST_TRIP              =
*   COSTDIST_STOP              =
*   COSTDIST_RECE              =
*   COSTDIST_MILE              =
*   AMOUNTS                    =
*   ADVANCES                   =
    return                     = lt_bapiret " says method was executed successful
          .

In the insides of the FM:

*  IF CALCULATE_AMOUNTS <> 'X'. "XJY
* import the trip because it was NOT imported before
  READ TABLE T_PERIO INDEX 1.
  TE-KEY-PERNR = T_PERIO-PERNR.
  TE-KEY-REINR = T_PERIO-REINR.
  TE-KEY-PERIO = T_PERIO-PERIO.
  TE-KEY-PDVRS = T_PERIO-PDVRS. " Once this line is executed, the global table USER is fileld with the data I expect
  RP-IMP-C1-TE.
*  ENDIF. "XJY
  if t_perio-abrec = '0' or
     t_perio-abrec = '1'.
    clear te-key-pdvrs.
    import beler from memory id te-key.
  endif.

I hope somebody has ever used this one and can tell me what I'm doing wrong...

Cheers, Lukas

Accepted Solutions (0)

Answers (2)

Answers (2)

Former Member
0 Kudos

Hi.

Take a look in function group HRTRV_IF, where the function module HRTRV_IF_GET_TRIP is declared. The function group includes a function module HRTRV_IF_GET_CUSTOMIZING, that will give you the user defaults in the structure EMP_INFO (PTRV_EMP_INFO = BAPITRVEMP).

Isn't this the user data you are seeking?

Lukas_Weigelt
Active Contributor
0 Kudos

Since nobody answered I enhanced the FM and mapped USER to USERDATA myself... now the FM works as it should have worked in the first place...

Former Member
0 Kudos

Hi Lukas,

I am having same issue. FM do not return USERDATA. Can you please share your enhancement.

Thanks a lot

Lukas_Weigelt
Active Contributor
0 Kudos

Errr... basically all I do is userdata[] = user[] in an implicit enhancement at the end of the FM. I'm playing around with the memory a bit to keep things tidy and only pass one recordset because we don't use ptk99 as a table but as a flat structure instead, but, really, all I do is pass local parameter "user" to exporting parameter "userdata". No magic involved!

Cheers, Lukas

Former Member
0 Kudos

Thanks for reply. I also wants to use it for one record only. We have a requirement to allow user to pick manager for trip in case they do not want to use Org level automatically assigned for work flow. So i need to capture manager info at trip level in case user wants to overrider manager for a particular trip.

I read you blog about how to enhance PKT99 and add user fields. we use ABAP webdynpro and I am adding a new field on review screen to capture manager info.. in case user want to specify.

Thanks a lot

Lukas_Weigelt
Active Contributor
0 Kudos

I see. It's funny because what you state was also one of our requirements. I.e. our Org-Management is so complex that automatic agent assigments via workflow are nearly impossible and we have to give our employees the means to select the agent / next processor / approver manually. Therefore I've enhanced FITE_VC_REVIEW and implemented a custom OVS Search Help and used PTK99 as data foundation for the selected agent.

It's nice to see you've flound and read my blog! Let me know if you hit a wall during your implementation or once you are done. Would love to hear how things turned out!

Cheers, Lukas

Former Member
0 Kudos

good to know. that you have already implemented similar thing. In our case if employee want to pick a manager he will only be given option from a custom table entries.

They way i was thinking was that there will be a checkbox that will say "Override Approver"

and when that will be checked text filed will be enabled with search help restricted to custom table entries.

I have one question. When I am enhancing FITE_VC_REVIEW and adding field in that view, I m finding it hard to track it. Looks like adding to General data screen will be much easier.


R u using ABAP memory to track field and use it at SMOD or you are using SAP memory ?

I am just starting on this one and not expert at webdynpros.. will ping you if i need any more help

and yes i just added following like in FM HRTRV_IF_GET_TRIP

read TABLE user INTO userdata INDEX 1


to get it to load userdata..

Former Member
0 Kudos

I will be great if you have documented all process and share document with me.

my email is ysandhu at gmail dot com

Thanks

Lukas_Weigelt
Active Contributor
0 Kudos

I'm using the ABAP memory. I felt safer doing it this way because once the process is completed, the garbage collector will sweep my allocated memory space and it'll be "clean" again. IMHO using the SAP Memory is only needed when you need some kind of data overhead between several callstacks / several sessions. Using the SAP-Memory for data transition in WDA would be a little excessive.

I would recommend implementing the search help in FITE_VC_REVIEW, because it's cleaner process-wise and in terms of navigation. I don't really understand why you find enhancing FITE_VC_REVIEW more difficult than FITE_VC_GENERAL_DATA, can you elaborate on that?

Basically, what I did was creating an overwrite exit for FPM_method ON_SAVE in the Comp Controller of FITE_VC_REVIEW, read the context of my custom agent-info and write it into the ABAP Memory.

Cheers, Lukas

Lukas_Weigelt
Active Contributor
0 Kudos

Sorry but I'm only sharing my ideas publicly on SCN; not via private messaging and not via private email, otherwise it would be senseless to have an open community forum.

In my humble opinion, it would also be better for you, if you find stuff out yourself with some hints here and there instead of swallowing up a sample solution

Former Member
0 Kudos

Fair enough. I will contact you in case I get stuck.

So did you add new field to review screen on general data screen for webdynpro ?

Thanks again

Lukas_Weigelt
Active Contributor
0 Kudos

For the particular case with the approver/agent I added new fields on the review screen, i.e. on FITE_VC_REVIEW.

Cheers, Lukas

Former Member
0 Kudos

Oh asked too soon.. just read your previous post . So you added it to review screen. I will do same.

Which context(component) did u use to add field. General data ?

I think where I was finding it difficult was that code was going into SMOD before in was coming into ON_SAVE.

I will try again

Lukas_Weigelt
Active Contributor
0 Kudos

I created a custom node with my own elements for the context. This way I don't have to fear for unwanted consequences that might come into existence by enhancing a standard node, because you never know when somebody who coded the standard is to lazy to use "move-corresponding" instead of a simple "=" and the application crashes because of a type-missmatch (Yes, I've already experienced this ).

Former Member
0 Kudos

Thanks,

I will do same. Will create a custom node in Component controller and will map it to view controller.

So where are you using HRTRV_IF_GET_TRIP to get value for existing trip userdata. New supply function for node using assistance class general_tip_data attribute ?

Sorry to bother you again..

Thanks

Former Member
0 Kudos

So i used supply function on custom node to read existing values and on_navigate(also take care of save) to handle in memory stuff.

got it to working..


Thanks

Lukas_Weigelt
Active Contributor
0 Kudos

Nice!