cancel
Showing results for 
Search instead for 
Did you mean: 

Can i put ME-SYNC_USER in T01?

Former Member
0 Kudos

Hi, i did an application with syncbo S01, and i put the ME-SYNC_USER in each syncbo...

Now, i´m doing an application with some syncbo T01, can i put ME-SYNC_USER too and in getlist and gedetail filter with this user?

Thanks,

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

I don´t know how can do it...

I and my abaper don´t understand the code.

Only need how obtain the user.

Thanks,

Former Member
0 Kudos

What is the issue? Code is straight forward??

Have a table in the backend - all mobile users are customized in that table. So only data gets transfered to middleware for mobile users.

In GETDETAIL handler, you ask for the sync user and only select the data for the sync user?

User is maintained in the general settings screen on MEREP_SBUILDER --- VOILA.....

Your abaper should understand it - simply by reading the remarks, cause they tell what happens

Regards,

Oliver

Former Member
0 Kudos

I need the user in getlist... i ask for the sync user but it´s blank.

What table in backend do you tell me? I don´t understand this table...

Thanks,

Edited by: Victor Capi on Apr 10, 2008 2:34 PM

Former Member
0 Kudos

Hi Victor,

this is a problem in your understanding I think:

When you run the replication, you call the getlist handler - at that time the user is empty - cause the getlist runs by an automatic job. But it is not really an issue, cause the data is stored on the middleware after replication and waits to be processed with the sync of the user. So: you create a table in the backend. In that table you enter all users that are using the mobile app. This is a table created by you! So when you run the GETLIST handler, you select over all users of that table. So you get the results into the middleware.

Once in the middleware, we have to look at the sync. And there you have the mobile user. Now you select the data from the middleware based on the user. It is there now, cause it was replicated for that user earlier. And so you get the data down to the device.....

Regards,

Oliver

Former Member
0 Kudos

I have a new table in backend associated a new SyncBO, i run GETLIST and all user are in middleware, ok?

My problem, when this user is in middleware, how can select the data from the middleware based on the user?

Thanks,

PD: i´m using T51, is the same?

Edited by: Victor Capi on Apr 10, 2008 4:55 PM

Former Member
0 Kudos

Hi,

yes, same technique for T51 and T01... well, to get the data down for the user now is the same like in S01 - you need to add the user in MEREP_SBUILDER and use this in GETLIST handler. You see in the code above that the code laverages between the user given at import and the table.... Well, at the end that is it

In short words:

- if replication runs, no user is assigned, so use the users form the table

- if sync runs, user is there, so use this user and select data for that user.

At the end this is pretty much it..... Hope it helps.

Regards,

Oliver

Ps.: look here, there it is described as well - hopefuly:

Relevant is the 3rd post - there it tells you how to setup the user.

Edited by: Oliver Kaluscha on Apr 11, 2008 12:29 PM

Former Member
0 Kudos

I create the filter:

http://img168.imageshack.us/my.php?image=snap62do9.jpg

I enable the filter:

http://img168.imageshack.us/my.php?image=snap63fl1.jpg

But when sync, i don´t receive nothing... Why? before i receive all, now i receive nothing.

Thanks,

Former Member
0 Kudos

Hi,

I think you have to change the type of the parameter. Go MEREP_SBUILDEr - Filtering criteria. If you check the type of the filter it will say no error - that is fine. But more relevant is the bottom part of the screen, there it prints the actual statement.

If it is like:

(

IUSER EQ 'ME-SYNC_USER'

)

Then the '....' is incorrect. It should be ME-SYNC_USER, without the ' '

Ok, to change this:

Make the page editable and right click into the ME-SYNC_USER field. A window will open and in there select the last entry. It is someting like ME-VALUE or so. After you did that, run the check again, the two ' ' should disappear.

Ok, generate and replicate again - then it will work.

Hope that helps!

Regards,

Oliver

Former Member
0 Kudos

Yes, this was my problem.

Thanks,

Answers (1)

Answers (1)

Former Member
0 Kudos

Hi Victor,

yes, posible - pretty much same logic at the end!

Tell your ABAPER to have a look into ALM_MEREP_095_GETLIST for the replicator job coding in the backend - to get the data down to the middleware at replication - be aware - at replication time youdo not have a user - so if you select for user at replicator time it delivers no data...... But he should get the point while looking at it.

Regards,

Oliver

Former Member
0 Kudos

mmmm, i don´t understand... but... i haven´t the table ALM_MEREP_095_GETLIST, why?

Thanks,

Former Member
0 Kudos

Hi,

cause it is a function module in SE37 - and it is for your ABAPer asa demo how he should build getlist and getdetail handlers. It ispart of the plugin 2003.1 or 2004.1. If your backend is not ECC6 then it should be there - if you have some other PM stuff as well.

Regards,

Oliver

Former Member
0 Kudos

mmmm, ok, i have this function... I thought that it was a table...

I see the function, but... i can´t see where fill the user.

Thanks,

Former Member
0 Kudos

???

Well, if you have a T01 BO - it is the same like in a S01 BO - while creating the SyncBO you fill the input parameter. As you have done it in S01 you will do it in T01.

BUT: as I said: the difference is the replicator in T01 BOs. If you run a replicator, you do not have the username. So the GETLIST is not filled with the username. So if you do a select like: select * form MITable where username == syncuser - it will return an empty list. So to have a complete list for the return, you need to implement a propper solution for the Replication. This is shown in this 090 BO I mentioned ealier! It is the GETLIST handler for MAM090 SyncBO - and this is a BO that is initially of type T01 and syncs userdata down to the device.

So, develop the GETLIST and GETDETAIL handlers first - in the way the 095 was created - then create the syncBO and fill the value for the syncUser with the default values. The default value has to be defined at the creation of the SyncBO in the middleware as well. But this you have done already for S01 - so you should know how that works.

Regards,

Oliver

Former Member
0 Kudos

mmmmm, i speakwith an ABAPER, but this:

"BUT: as I said: the difference is the replicator in T01 BOs. If you run a replicator, you do not have the username. So the GETLIST is not filled with the username. So if you do a select like: select * form MITable where username == syncuser - it will return an empty list. So to have a complete list for the return, you need to implement a propper solution for the Replication. This is shown in this 090 BO I mentioned ealier! It is the GETLIST handler for MAM090 SyncBO - and this is a BO that is initially of type T01 and syncs userdata down to the device."

I don´t understand, because in the example:

FUNCTION alm_merep_095_getlist.
*"----------------------------------------------------------------------
*"*"Lokale Schnittstelle:
*"  TABLES
*"      MAM_SCENARIO_LIST STRUCTURE  MAM_20_MAM_SCENARIO
*"      RETURN STRUCTURE  BAPIRET2
*"----------------------------------------------------------------------
*
* All possible MAM Scenarios are returned here
*
* The customizing detail data is returned in the getdetail
* function module

* BAdI Data
  STATICS lr_badi_scenario  TYPE REF TO if_ex_alm_me_095_cust_scen.

* There are no error messages possible
  SELECT * FROM alm_me_c000 INTO TABLE mam_scenario_list.

*##########################################################
* Call customer BAdI
*##########################################################

* iniztialize BAdI
  IF lr_badi_scenario IS INITIAL.
    CALL METHOD cl_exithandler=>get_instance
*    EXPORTING
*      EXIT_NAME = 'ALM_ME_095_CUST_SCEN'
    CHANGING
      instance = lr_badi_scenario.
  ENDIF.

* call BAdI to fill the customer enhancements
  CALL METHOD lr_badi_scenario->getlist
    CHANGING
      scenario_list = mam_scenario_list[]
      return        = return[].

ENDFUNCTION.

I can´t see where fill the user.

Thanks,

Edited by: Victor Capi on Mar 4, 2008 3:12 PM

Former Member
0 Kudos

:-$ oh sorry -$

it is the 090 - not the 095

check to 090 out

:-$

Former Member
0 Kudos

mmmmm, i have the code of ALM_MEREP_090_GETLIST


FUNCTION alm_merep_090_getlist.
*"----------------------------------------------------------------------
*"*"Lokale Schnittstelle:
*"  TABLES
*"      CUSTOMIZED_USERS STRUCTURE  MAM_20_USER_DATA
*"      RETURN STRUCTURE  BAPIRET2 OPTIONAL
*"----------------------------------------------------------------------
*
* SyncBO 090 = Userspecific customizing
*
* The returntable holds a list of all users set up in
* MAM customizing
* If users are already passed from the table, only these
* users are selected (used for server-driven).

  DATA ls_alm_me_d997 TYPE alm_me_d997.
  DATA lv_message.                                    "#EC NEEDED Dummy
*  DATA ls_return    TYPE bapiret2. "Not needed due to table parameter
  DATA lt_alm_me_d997 TYPE TABLE OF alm_me_d997.
  DATA ls_user_data   TYPE alm_me_user_data.

* BAdI data
  STATICS lr_badi_cust_user TYPE REF TO if_ex_alm_me_090_cust_user.

*##########################################################
* Check customizing, if selection is active
*##########################################################
  CALL FUNCTION 'ALM_ME_SELECTION_ACTIVE'
       EXPORTING
            syncbo                 = gc_syncbo_090
            method                 = gc_method_getlist
       EXCEPTIONS
            syncbo_method_inactive = 1
            OTHERS                 = 2.
  IF sy-subrc NE 1.
***********************************************************
* Select users
***********************************************************
    SELECT * FROM alm_me_d997 INTO TABLE lt_alm_me_d997.

    IF sy-subrc NE 0.
* Keine Benutzerzuordung zu MAM Szenarien gefunden
      MESSAGE e008(alm_me) INTO lv_message.
* In case of error fill return table
      CALL FUNCTION 'ALM_ME_MESSAGE_TO_RETURN'
           TABLES
                return = return.
* -> Exit
      EXIT.
    ENDIF.

* Check if table was filled from middleware
    DATA lv_lines TYPE i.
    DESCRIBE TABLE customized_users[] LINES lv_lines.
***********************************************************
* Get headers
***********************************************************
* Map the customizing table to the function module interface
* to be sure changes on the database or interface will not
* cause any troubles.
    LOOP AT lt_alm_me_d997 INTO ls_alm_me_d997.
* When users are given in the table, just select them,
* and not all users
      IF lv_lines NE 0.
        READ TABLE customized_users
          WITH KEY userid = ls_alm_me_d997-userid.
        IF sy-subrc NE 0.
* Entry not found, continue loop without adding the data
          CONTINUE.
        else.
* Delete the passed entry since it will be added with data below
          DELETE customized_users[] index sy-tabix.
        ENDIF.
      ENDIF. "Users where passed from middleware
* Get the data
      CALL FUNCTION 'ALM_ME_USERCUST_HEADER'
           EXPORTING
                customizing_user =
                   ls_alm_me_d997-userid                 "#EC DOM_EQUAL
           IMPORTING
                user_customizing_head  = ls_user_data
           TABLES
                return                 = return
           EXCEPTIONS
                customizing_read_error = 1
                OTHERS                 = 2.
      IF sy-subrc NE 0.
        MESSAGE w029(alm_me)
          WITH 'Benutzer'(001) ls_alm_me_d997-userid
          INTO lv_message.
        CALL FUNCTION 'ALM_ME_MESSAGE_TO_RETURN'
             TABLES
                  return = return.
      ELSE.
        MOVE-CORRESPONDING ls_user_data TO customized_users.
      APPEND customized_users.
    ENDIF.
    ENDLOOP.
  ENDIF. "Standard selection active

*##########################################################
* Call customer BAdI
*
* The BAdI can be used to select a own order list
* or to modify the data selected.
* The data returned in order_list must be the same
* content as in getdetail ORDER_HEADER for the same
* order. Therefore usually the getdetail BAdI has
* to be implemented as well
*##########################################################
* iniztialize BAdI
  IF lr_badi_cust_user IS INITIAL.
    CALL METHOD cl_exithandler=>get_instance
*    EXPORTING
*      EXIT_NAME = 'ALM_ME_090_CUST_USER'
    CHANGING
      instance = lr_badi_cust_user.
  ENDIF.

* call BAdI
  CALL METHOD lr_badi_cust_user->getlist
    CHANGING
      user_list = customized_users[]
      return    = return[].


ENDFUNCTION.

But i continue without see where fill the user...

My application is offline, work?

I have to add the code in my bapi getlist and getdetail no?

The user in the middleware or in the backend have to setup in any table?

Thanks,

Former Member
0 Kudos

Hi Victor,

as I tried to tell you - that is the basic problem in working with T01 BO and user selection!

While running the GETLIST there is NO USER! So MAM090 used an additional table to provide that user information.

And then the Sync could work with the user as well..... yes.

But that is in the code above - so still I have the problem to understand your issue correctly.........

Ok, in principle (how they did it)

Create a user table in backend and fil it with possible user data and configuration

crate the getlist and getdetail handler

at replication time read that table and get the users in the getlist....

At sync time fill the user like you did in S01 (that has not changed)

So, basically: it is straight forward

Regards,

Oliver

Former Member
0 Kudos

Ok... so, if i want pass the user in syncbo T01...

I have to create a table with an user and syncbo S01, so, in each sync i create new row in the table user with the user, and in the getlist T01 i go to the user in the table of syncbo S01 no?

Thanks,

PD: can i send the user in syncbo t51?

Edited by: Victor Capi on Mar 4, 2008 5:49 PM

Former Member
0 Kudos

Hi Victor,

I have a problem with your complete description - in the first request you tell us, you know how to send the user..... So filling the default value should be ok for you - or is that unclear to you?

Ok, then it is logic:

Replication has no user

If the getlist references a user it delivers an emty dataset

so replication delivers nothing to the middleware if you use a user already at replicartion time and with that you will not see any data in the middleware and so nothing on the device.

Up to that point: is that logical and clear?

So the user table is for replication - at sync you do not add a row to the table - cause then you have the sync user.

In t51 the issue is the same! And yes: user can be given.

Regards,

Oliver