How to get user and system status for a trade promotion

Hi,
I have to develop a batch program to change user status and system status of all trade promotions which satisfy some criteria. This criteria checks some dates related to trade promotion(like Changed on,Pallett buying, buying horizon dates) also.
I thought of first extracting all external ids from CGPL_PROJECTS table and then run trade promotion query. But how can I get current user & system status and all dates as these can be taken from relations "TPMStatusActiveRel" and "TPMDateRel". I don't know to take data from relations. Please help me with a piece of code.
Thanks.

Hello Shikha,
You can use these relations here, as you are not in the Business Object layer anymore. As far as my understanding is, all the batch programs or reports should be done at the API layer. Try this code, to read the status of the Trade Promotion object.
data: lr_appl_base type ref to CL_CRM_MKTPL_APPL_BASE,
        lt_sys_status type CGPL_ISTATUS_TEXT_T.
lr_appl_base ?= CL_CRM_MKTPL_APPL_BASE=>GET_INSTANCE().
" To read system status
call method lr_appl_base->STATUS_READ
exporting
IM_MKTELEMENT_GUID = "your Trade promotion guid
ET_TJ02T  = lt_sys_status.
" To read user status
call method lr_appl_base->STATUS_READ_EXTERN
exporting
IM_MKTELEMENT_GUID = "your Trade promotion guid
ET_TJ02T  = lt_sys_status1.
To change the user status, use the method STATUS_CHANGE_EXTERN of the same class
To set the system status, use the method STATUS_SET of the same class.
Hope this helps.
Regards,
Vinay

Similar Messages

  • Posibilities of user and system status?

    Hi CRM experts,
    I've some doubts respect the user and system status configuration.
    My client wants to stop the upload process (to R3 site) of a Sales Order document, regarding a specific user status. Then, they want to restore the uploading process regarding into a specific user status different from the firts one.
    User Status -             System Status
    Status 1 -                Stop uploading process
    Status 2 -                Restore the uploading process
    I made the following customizing in my status profile (assigned to my Sales Order transaction)
    User Status -  Transaction Control -  Forbidden -  Set
    Status 1 -     To be distributed -    X -           X
    Status 2 -     empty -           empty -           empty
    When I save a Sales Order in Status 1, the BDOC is correctly generated and the document is not present in R3 environment. The problem occurs when I modify the Status, from Status 1 to Status 2. The document is in R3 environment (???) but the generated BDOC remains in Yellow light.
    Is correct to implement this uploading behaviour regarding a user status like my configuration? May I implement some checks on the upload BADI better?
    I need some help in these questions please.
    Thanks in advance

    Hi,
    It might be easier if you could come to a scenario were one specific user status should trigger the distribution. Then you have a direct link between a user status & a system status, meaning that there is no need for additional coding.
    If the bdoc remains in intermediate state, then that means there's an error in the queues or a short dump. check transactions smq1 & smq2 and ST22 in both systems.
    Michael.

  • User status and System status for Trade Promotion

    Hi all!
    CRM 7.0 Web UI Trade Promotion Management.
    I have a trade promotion with custom status already assigned and visible from WEB UI, Is it possible assigning to such TP also a standard status picked amongst TP system status?
    Take into account that in the as is configuration we find in the same TP drop down list user status and system status.
    2 questions:
    1.     How can I hide the system status?
    2.     It is possible to group together user status and system status? E.g. User status: fundrequest, inplanning, submitted...+ released (system status).

    Hi Virginia Zitun,
    Can you tell me how did you manage to solve the issue.
    rgds,
    Venkat

  • Service tickets - User and system status

    Hi guys
    This is the scenario, there was a complaint raised by our resolver groups saying that they were unable to open any service tickets logged through to them from our Contact Centre Agents. All this happened in a space of 5 hours only
    Under the Header Overview of these service tickets, when I view the changes to this document, i saw that every service ticket that was logged user status shows CLOSED and system status shows COMPLETED
    Please advise what could have caused this?
    Ravi

    Hi Arden
    Went through a few of those cases and picked up this
    The last system status entered shows TO BE DISTRIBUTED - by the Interaction Agent user
    Responsible Group deleted - and new value shows the new responsible group
    But the time frame bewteen the old value and new value is what concerns me. Theres a gap of about 45 minutes on average from the time the case is logged "open" till the time the case is "in process" by the resolver
    But as per the resolver groups, they could not access these cases once they were logged. So it seems these cases were all "locked" basically and could only be access minutes later
    Ravi

  • Validate the user and system status

    hi sap,
    i have a requirment where i need to validate
    if system status = ( ISTAT = 'I0002' AND " released
    ISTAT = 'I0098' AND " create
    ISTAT = 'I0119' ). " active
    if the system status ( ISTAT = I0119 Which is ACTIVE then
    it should CHANGE the user status.
    if the system status ( ISTAT = I0002 Which is RELEASED then
    It should NOT CHANGE the user status.
    if the system status ( ISTAT = I0098 Which is CREATE then
    It should NOT CHANGE the user status.
    I have and internal table like this but i dont get the data what is the worng can you pls tel me where i went wrong
    how do i validate the above formula?
    data:begin of wa_itab,
    spras TYPE tj02t-spras,
    istat TYPE tj02t-istat,
    end of wa_itab.
    data: sys_itab like standard table of wa_itab.
    SELECT spras
    istat FROM tj02t
    INTO TABLE sys_itab
    WHERE spras = 'E'
    AND ( istat = 'I0002' AND
    ISTAT = 'I0098' AND
    ISTAT = 'I0119' ).

    Hi ,
    Use this.
    DATA:BEGIN OF wa_itab,
       spras TYPE tj02t-spras,
       istat TYPE tj02t-istat,
      END OF wa_itab.
      DATA: sys_itab LIKE STANDARD TABLE OF wa_itab.
      SELECT spras
      istat FROM tj02t
      INTO TABLE sys_itab
      WHERE spras = 'EN'
      AND istat in ('I0002','I0098','I0119').
    Regards,
    Vijay

  • Trigger how to get new and old value for nested table column?

    Hi,
    I have created a nested table based on the following details:
    CREATE TYPE typ_item AS OBJECT --create object
    (prodid NUMBER(5),
    price NUMBER(7,2) )
    CREATE TYPE typ_item_nst -- define nested table type
    AS TABLE OF typ_item
    CREATE TABLE pOrder ( -- create database table
    ordid NUMBER(5),
    supplier NUMBER(5),
    requester NUMBER(4),
    ordered DATE,
    items typ_item_nst)
    NESTED TABLE items STORE AS item_stor_tab
    INSERT INTO pOrder
    VALUES (800, 80, 8000, sysdate,
    typ_item_nst (typ_item (88, 888)));
    Now I would like to create a trigger on table pOrder for after insert or update or delete
    and I would like to track the new and old value for the columns inside nested table.
    Can anybody direct me how to do it?
    I would like to know the sytax for it like:
    declare
    x number;
    begin
    x := :new.nestedtablecolumn;--how to get the new and old value from nested table columns
    end;
    Hope my question is clear.
    Thanks,
    Lavan

    Hi,
    Try like this:
    CREATE OR REPLACE TRIGGER PORDER_I
    BEFORE INSERT
    ON PORDER
    REFERENCING OLD AS old NEW AS new
    FOR EACH ROW
    DECLARE
      items_new typ_item_nst;
      ordid_NEW NUMBER;
    BEGIN
    FOR i IN :new.items.FIRST .. :new.items.LAST LOOP -- For first to last element
      DBMS_OUTPUT.PUT_LINE(':new.items(' || I || ').prodid: ' || :new.items(I).prodid );
      DBMS_OUTPUT.PUT_LINE(':new.items(' || I || ').price:  ' || :new.items(I).price );
    END LOOP;
    END;Regards,
    Peter

  • How to get telephone and mobile phone for one partner

    Hello Expert,
    In VA03, I open one sales order and go into the partner tab. Then I selection one partner and click "Detail" button, one page with partner detailed information will pop up.
    In the pop-up window:
    There are two fields: Telephone and Mobile Phone.
    In my program, I want to get these two information. 
    I tried to call FM 'ADDR_COMM_GET' by passing address_number(VBPA-ADRNR), table_type('ADTEL'), iv_current_state(SPACE). For some partner, it works, but for others it doesn't work.
    Then I find table ADR2 which is used to keep phone infomration. There are two entries in the table. But how can I identity which one is telephone and which one is Mobile phone?
    So can any expert help me on how to get the telephone and Mobile Phone of the pop-up page?
    Thanks in advance,
    Best Regards, Johnny.

    Read ADR2-TEL_NUMBER where ADDRNUMBER = VBPA-ADRNR and R3_USER = '2' or '3'.
    These are the possible values
            Telephone is Landline Telephone
    1     Telephone is Default Under Landline Telephones
    2     Telephone is Mobile Telephone but Not Default Mobile Phone
    3     Telephone is Default Mobile Telephone
    X     Obsolete - No Longer Valid

  • How to get users' login logout time for user IDs for a specific date?

    Dear All,
    There is a case I being requested to retrieve the Userid, User Name,
    User Group, User Dept, Date, Login Time, Logout Time in a specific date, for example, 21.05.2009.
    How should I retrieve the information? The user want to input specific date and user group then return the details that mentioned above.
    I try with SUIM->Users->By Logon Date and Password Change... but I can't specific the date that I want ...
    I try with SM19 (Security Audit Log), but unfortunately in my system this is not activated.
    I've seek for SAP's advise, and they say need to ask abaper to developr a report in order to get such details....
    Do you guys have any other methods?
    Do you guys know which tables will contain the details as mentioned above?
    Best Regards,
    Ken

    Unfortunately without the audit log, you're going have a hard time finding this information.  As mentioned, ST03N will give you some information.  If your systems daily workload aggregation goes back to the date you require then you'll be able to get a list of all users who logged on that day.  ST03N doesn't keep time stamps just response times.
    My only idea is VERY labor intensive.  If your DB admin can retrieve a save of the database from that day then table USR02 will hold a little more information for you.  It will contain last login times for that day.  If your system backup policy happened to have saved the contents of folder "/usr/sap/<SID>/<instance>/data" then you potentially have access to all the data you require.  The stat file will have recorded every transaction that took place during that day.  If that file is restored you could use program RSSTAT20 to query against it.
    Good luck and turn on the audit log as it makes your life much easier!

  • User and system status

    Hello,
    I've used before a function module which returns the status of a maintainance notification. unfortunately I cannot recall the name of the function.
    Does anyone have a clue?
    Tomer.

    Hi,
    Thanks for the reply...
    I can get the logic from there. Anyhow, Do we have a function for getting the user status of a notification?
    Tomer.

  • How to get drivers and download drivers for my HP 2000-261NR notebook?

    I need to download all the original drivers for my HP notebook so that they may be reinstalled on a new hard drive. The old hard drive failed.  A new harddrive and Windows 7 64 bit OS have already been installed. The HP support website locks up in a continuous loop when it says it is searching for drivers.  It's been almost an hour and it is still searching with no results showing. Here's a link to the page in question: http://support.hp.com/us-en/drivers/selfservice/hp-2000-200-notebook-pc-series/5091493/model/5119024#Z7_3054ICK0K8UDA0AQC11TA930O2 Been there for ages with nothing happening. In the past all we had to do was enter our model number and all the drivers available for download would be displayed. Why not the same thing now?

    Hi  ,
    Thank you for visiting the HP Forums! A great place where you can find solutions for your issues, with help from the community!
    I came across your post about the Notebook, and wanted to assist you! I have looked into your issue about your HP 2000-216NR Notebook  and issues with the driver page. Here is a link to the driver page that might help. Here is a link to the HP Support Assistant if you need it. Just download and run the application and it will help with the software and drivers on your system that need updating. Here is a document on Hp Recovery Manager that will help you with any software and drivers that might need reinstalling. Hope this helps. Thanks.

  • Maintain the link between user status and system status

    Hi friends,
    my requirement is In crm transactions when we change the system status(inprocess) then the relevant user status            (inprocess) is also to be changed automatically. how can we do this? wt r the customisations we can do for this?
    pls suggest me? thanks in advance.

    Hi Madhu Sudan,
    When you create User Status in Status Managment...
    Eg: Inprocess
    You assign User Status Triggers Business Transaction.
    So, This maintain the link between the User and System statuses.
    Reward Points if helpful.
    Srini.

  • Changing the System status for previous transactions

    Hello,
    Could some body help me with this ?
    I have a User status profile with user status ABC which triggers system status Inprocess. This is applicable for all the new transactions for which we set the status ABC which works fine. But we have some previous transactions  ( Prior to this config ) with status ABC , but system status is not Inprocess.
    How can we change the system statuses for all these transactions? do we have a report for this?
    Best Regards,

    Hi,
      You can use 'STATUS_CHANGE_INTERN' FM to change the system status. Pass Object number and status ID as inputs to the Function Module.
    Regards,
    Lakshmi.Y

  • Valid System Status for Floc or Equip

    Hi all,
    I am finding my way to find all the valid system status for Func Location and Equipment; hope someone can give me an answer to it :). When I go to tcode BS23, I can see all the system status are there.
    However, how do I know which one are valid for Equipment for example. I know that AVLB, INST, INAC, DLFL are available as I commonly seen it. But how about the rest of the system status that can be attached to Equipment?
    Regards,
    effie7am

    Hi NPB,
    That is how we define the initial system status for that object. I have tried to go to the object types in BS23 and then choose the object then: go to >> object type info.
    However, for equipment it is only given AVLB which is for me is not right. But for functional location and maintenance order, it seem showing all the necessary system status that are available in there.
    Anyhow, that for giving me some idea on hor to dig into it.
    Regards,
    effie7am

  • User exit for Previous and current system status  for  5 transactions

    Hi Experts
    My Objective to capture the Previous and current status  of system status  for  5 transactions  in their  user exits .
    Description                                         Business Object               Transaction
    Production Order operations              BUS2005                            CO02 to edit Production Order
    Maintenance Orders                           BUS2007A                         IW32 to edit Plant Maintenance Order
    INTernal   ORDER                                 BUS2075                          KO02 to edit Internal Order
    WorkBreakdownStruct                       BUS2054                          CJ02 To edit the WBS element
    Project System Network                      BUS2002                           CN22 to edit Network
    Activities Network
    For Both Production order  and   Project System Network Activities Network    ,
    i got  User exit  "  EXIT_SAPLCOBT_001  " 
    But i am not sure whether we can use this or  not for our purpose . When i am changing status and  then saving ,  my  break point comes  to  EXIT_SAPLCOBT_001  .
    But  can we capture   JEST   or   JCDS  related  data   in that  user  exit  or  How can we capture both Previous status  and Current ( Means New changed status ) . For eg  From Released   to   Technically complete   etc.
    I want Status changed and its immedtiate previous status. 
    Do i need to check Exit  or BADI  before  and after Saving .
    Thanks
    Regards
    Gaurav
    Edited by: TheGaurav on Sep 8, 2011 10:28 AM

    Hi Himanshu
    Many Thanks for the reply . 
    I also had some other processing needs to be done on the basis of those status. .
    So do you have any idea or  how to find what all exits or BADIs  i can use for all of these 5 transactions , where
    i can get data for JCDS ( or JEST ) .
    CO02 to edit Production Order                 
    IW32 to edit Plant Maintenance Order
    KO02 to edit Internal Order
    CJ02 To edit the WBS element
    CN22 to edit Network        
    can we use   EXIT_SAPLCOBT_001  for    CO02  and  CN22   .
    Edited by: TheGaurav on Sep 8, 2011 1:21 PM

  • How to Control authorization for users with certain status for level 2 WBS Element

    Dear All,
    Is there any standard way or enhancement available to control authorization for users with certain status for WBS Element i.e. for example
    Pre-requisite:
    There is only 2 level of project i.e.
    Lev_ WBSE_______Description
    1___ 7-14.E_______summay outage controller
    2___ 7-14.E.2310__ Plant/unit # 2310
    2___ 7-14.E.2310__ Plant/unit # 2220
    Project Controller  (authorization role assigned "Z_PS_OP7_OTGCON_C") have all project level authorization
    Plant/Unit Controller (authorization role assigned "Z_PS_OP7_PLNTOTG_C_2310") have only level 2 authorization with enhancement that we did in system by Z table.
    User ID_ Plant #
    123345_ 2310
    122455_ 2220
    Issue:
    After System Status released and User Status approved the WBS basic date for Plant/Units should be restricted from updating/changing by Plant/Unit Controller level and only project controller should have this authority.
    Solution required: 
    Can any one tell how to control this scenario either by standard or enhancement available to control authorization
    BR
    Saqib Usman   

    Hi,
    Did you explore SAP Enhancement CNEX0002 Using Transaction CMOD?
    Thank you and regards,
    Varshal Kachole
    The SCN Rules of Engagement

Maybe you are looking for