How to use the next 'initial' cost center in infotype 0027

Hello experts!
I need some help in posting in infotype 0027 which should be fairly easy to most of you. As you guys know, there are a total of 25 cost centers available (KST01-KST25) for this infotype. What I want to do is check from KST01 if it exists with a valid entry at a specific date (BEGDA and ENDDA will be provided as well) all the way up to KST25 and choose the first cost center field that is INITIAL. This is used before 'BAPI_COSTCENTER_CREATEMULTIPLE' so that if KST01 up to KST05 all have values on the same BEGDA & ENDDA, how can I have KST06 chosen? Thanks in advance for your help!

Hi,
   Write as below.
data : p_0027 like pa0027 occurs 0 with header line.
data : lv_KOSTL type KOSTL.
data : lv_index(2) type n.
data : lv_cost(12).
field-symbols : <lv_kostl> type any.
select single * from pa0027 into p_0027.
do 25 times
      varying lv_KOSTL from p_0027-KST01 next p_0027-KST02.
  lv_index = lv_index + 1.
  IF lv_KOSTL is initial.
    concatenate 'KST' lv_index into lv_cost.
    exit.
  endif.
enddo.
assign  component lv_cost of structure p_0027 to <lv_kostl>.
IF sy-subrc = 0.
<lv_kostl> = '100'.    " <-- Assign any value here
ENDIF.
Regards,
Srini.

Similar Messages

  • How to restrict the users specific cost center/profit center in FBCJ transaction.

    Hello Guru's
    We have created multiple profit centers across india. So I would like to restrict area wise profit center to use the users.
    ex ; I have created for MUMBAI M001 to M009 range and for Hyderbad I have created H001 to H009.
    So my requirement is Only Mumbai user should able to post the entries in FBCJ transaction and should not able to post other area's which are hynderbad and so on.
    In T code FBCJ, Users are able to post to any cost center/profit center even it is not in the range of B001 to B991. I have maintained these values in object K_PCA and org levels as well
    Kindly provide your valuable solutions’.
    Thanks
    Mohan

    Hi Rajiv,
    Thanks for information.
    I have already restricted the filed RESPAREA of K_PCA. Please find the below details.
    PCFFCLB001-PCFFCLB991, PHFFCLMUMBAI
    However still the user is able to post the entries in other area's (hydarbad n delhi..). Can you please let us know other solution.
    Let me know if you need any other details.
    Thanks
    Mohan

  • How to use the 'next' softkey in XML Directory - SPA504G

    I have the basic XML Directory stuff working (CiscoIPPhoneDirectory) on the SPA504G. However I realise I can only display 32 entries and I note that there is a "next" softkey enabled, however it seems to not do anything. How can I link this button press to fetching a new url with the next page of 32 results - I am ok dealing with the server side of this.
    Looking at the xsi_dev_guide (which I am not sure is applicable to the SPA504G), talks about adding a Refresh HTTP Header, however it is a bit vague and whenever I add it to the HTTP response, the spa504 barfs (invalid response).
    Do I need to program the next softkey to send a URL or something?

    Do I need to program the next softkey to send a URL or something?
    Yes, definitely. The "Next" soft key is not magic key of any kind. It just standard "request a page from HTTP server" key. It should issue a HTTP request for next page.  Like "Prev" key is asking for previous page content.
    So you need something like:
    <SoftKeyItem>
    <Name>Next</Name>
    <URL>https://.../Cisco/Directory.php?page=2</URL>
    <Position>3</Position>
    </SoftKeyItem>
    Note that you should NOT claim Next key on last page. Phone will choke on empty CiscoIPPhoneDirectory (e.g. no entry). For same reason you should not declare Prev key on first page.
    Looking at the xsi_dev_guide (which I am not sure is applicable to the SPA504G), talks about adding a Refresh HTTP Header, however it is a bit vague and whenever I add it to the HTTP response, the spa504 barfs (invalid response).
    Yes, xsi_dev_guide apply to SPA504G as well. Although Refresh is not claimed by a formal standard, it's de-facto standard recognized by many browsers already. Thus it's not documented in detail heres. In the context of example above you should emit ...
    Refresh: 0; url=https://.../Cisco/Directory.php?page=2
    ... header here.
    Rate useful advices. It will help others to found solutions.

  • Pop Up blocker exceptions are not saved in the browser for use, the next time the PC reboots. How do you save these exceptions for long term use?

    Pop Up blocker exceptions are not saved in the browser for use, the next time the PC reboots. How do you save these exceptions for long term use?

    In case you are using "Clear history when Firefox closes":
    *do not clear the Site Preferences
    *Tools > Options > Privacy > Firefox will: "Use custom settings for history": [X] "Clear history when Firefox closes" > Settings
    *https://support.mozilla.org/kb/remove-browsing-search-and-download-history
    Note that clearing "Site Preferences" clears all exceptions for cookies, images, pop-up windows, software installation, passwords, and other website specific data.
    If you have software like Advanced SystemCare (Surfing Protection feature) that might reset some files to older versions to protect these files against changes then check the settings or uninstall this software.

  • How to delete the one of cost centers in Splitting Structure(OKEW)?

    Dear All,
    I have a question about Splitting Structure as below? Could I get favor from you? Thanks a lot.
    How to delete the one of cost centers in Splitting Structure(OKEW)?
    Jocha

    Hi Chang
    Welcome to SDN! Its our pleasure to help you here
    Step 1: Select your Cost Center in OKEW which is assigned to the Splitting Str
    Eg: Cost Ctr 1001 is assigned to Splitting Str Z1... Tick the Check box against 1001 under Z1 Splitting Str
    Step 2: Do a Single Click on the text "Non Assigned Cost Centers"
    Step 3: Press Shift +F6 (Or Click on the Assign Button, next to the Pencil icon)
    Br, Ajay M

  • How to use the mesh tool

    I am not sure how to use the mesh tool

    it can be tricky! it's best to use with geometric shapes and not random figures that you create with the pen or brush tools.
    so lets say you wanted to make an apple using a real picture for reference. first off, you'd place the picture of the real apple in the background. next, you would choose the circle tool to create a circle around the apple. then, you would use the mesh tool and press the center anchor to create a simple grid looking form onto the circle. grab the selection tool to move around the anchor points surrounding the apple to make a more accurate outline. after this step, it's easier to add more anchor points for the actual apple! all you must do is grab the pen tool and add more anchor points along the path and use the selection tool to move the anchor points around the apple; eventually it'll look somewhat like a 3D graph of an apple. important tip to remember, the less lines the better. but a few are okay.
    so after you've graphed/mapped out your apple you're going to want to press the selection tool and use your eyedropper tool to get an accurate color of the spot/anchor you selected. the basic point of the mesh tool is to outline a picture,@ and with the eyedropper tool you can use the exact colors from the original picture you're working from. i learned this technique from class. here's my example it can be a really useful tool if it's what you're looking for.

  • JNI - How to use the error reporting mechanism?

    I've developed a C++ DLL which is loaded from a commercial Win32 application (not written by me) as a plug-in for external calculations. On its initialization the C++ DLL launches the Java VM via the JNI invocation interface. When the DLL functions are called by the application, they forward the calls to Java objects inside the Java VM, again via JNI invocation interface.
    This works well, but I have encountered a weird error.
    From Java I open a JFrame containing a JTextArea as small console for debug output messages. If I turn output to this debug console off (my printToConsole routine checks whether a boolean flag is set), the string concatenation operator may lead to a crash of the Java VM.
    For example, if in one of the Java functions called from the
    DLL via JNI invocation interface the following is the first statement,
    it leads to a crash of the Java VM and the application that loaded the C++ proxy DLL.
    String test=""+Math.random(); // String test not used later
    Interestingly, if I comment this statement out, the Java code works fine WITHOUT any crash. I've already thought about potential races and synchronization issues in my code, but I don't see where this is the case. And the string concatenation error fails as well, if I insert sleep() statements in front of it and at other places in the code. However, if I turn on log messages printed to my JFrame debug console (containing a JTextArea), the String concatenation works without problems.
    So maybe the JNI interface has a bug and affects the Java VM; I don't see where my JNI code is wrong.
    One problem is that I do not get any stdout output, as the C++ proxy DLL is loaded by the Windows application, even if I start the Windows application from the DOS command line (under Windows).
    Does anyone know how to use the error reporting mechanism?
    http://java.sun.com/j2se/1.4.2/docs/guide/vm/error-handling.html
    Is it possible that the JVM, when it crashes, writes debug information about the crash into a file instead of stdout/stderr?
    My C++ proxy DLL was compiled in debug mode, but the commercial application (which loaded the DLL) is very likely not.
    I do not know hot to find the reason why the String concatenation fails inside the Java function called from the C++ DLL via JNI.

    Yes, I've initially thought about errors in the C++ code too. But the C++ code is actually very simple and short. It doesn't allocate anything on the C++ side. It allocates a couple of ByteBuffers inside the Java VM however via JNI invocation interface calls of env->NewDirectByteBuffer(). The native memory regions accessed via the ByteBuffers are allocated not by my own C++ code, but by the program that calls my DLL (the program is Metastock).
    The interesting thing is that everything works fine if output to my debug console is enabled, which means that in the Java print routine getConsoleLoggingState() returns true and text is appended to the jTextArea.
    static synchronized void print(String str)
    { MetaStockMonitor mMon=getInstance();
    if ( mMon.getFileLoggingState() && mMon.logFileWriter!=null) {
    mMon.logFileWriter.print(str);
    mMon.logFileWriter.flush();
    if ( mMon.getConsoleLoggingState() ) {
    mMon.jTextArea1.append(str);
    Only if output to the JTextArea is turned off (ie. getConsoleLoggingState()==false), the crash happens when the FIRST statement in the Java routine called via JNI invocation interface is a (useless) String concatenation operation, as described above.
    String test=""+Math.random(); // String test not used later
    Moreover, the crash happens BEFORE the allocated ByteBuffer objects are accessed in the Java code. But again, if console output is turned on, it works stable. If console output is turned off, it works when the (useless) String concatenation operation is removed in the Java routine called from C++.
    I've already thought about potential races (regarding multiple threads), but this can be ruled out in my case. It almost appears as if the JVM can have problems when called by the invocation interface (I tested it with Java 1.4.2 b28).
    All the calls between C++ and Java go ALWAYS in the direction from C++ code to Java. Unfortunately, there is no special JRE version with extensive logging capabilities to facilitate debugging. And the problem is not easily reproducible either.
    JNIEnv* JNI_GetEnv()
    JNIEnv *env;
    cached_jvm->AttachCurrentThread((void**)&env,NULL);
    fprintf(logfile,"env=%i\n",env);
    fflush(logfile);
    return env;
    // function called by Metastock's MSX plug-in interface
    BOOL __stdcall createIndEngine (const MSXDataRec *a_psDataRec,
    const MSXDataInfoRecArgsArray *a_psDataInfoArgs,
    const MSXNumericArgsArray *a_psNumericArgs,
    const MSXStringArgsArray *a_psStringArgs,
    const MSXCustomArgsArray *a_psCustomArgs,
    MSXResultRec *a_psResultRec)
    a_psResultRec->psResultArray->iFirstValid=0;
    a_psResultRec->psResultArray->iLastValid=-1;
    jthrowable ex;
    jmethodID mid;
    JNIEnv* env=JNI_GetEnv();
    jobject chart=getChart(env, a_psDataRec);
    if ( chart==NULL) {
    return MSX_ERROR;
    jobject getChart (JNIEnv* env, const MSXDataRec *a_psDataRec)
    jthrowable ex;
    jmethodID mid;
    int closeFirstValid, closeLastValid;
    closeFirstValid=a_psDataRec->sClose.iFirstValid;
    closeLastValid=a_psDataRec->sClose.iLastValid;
    long firstDate, firstTime;
    if (closeFirstValid>=1 && closeFirstValid<=closeLastValid) {
    firstDate = a_psDataRec->psDate[closeFirstValid].lDate;
    firstTime = a_psDataRec->psDate[closeFirstValid].lTime;
    } else {
    firstDate=0;
    firstTime=0;
    jclass chartFactoryClass = env->FindClass("wschwendt/metastock/msx/ChartFactory");
    if (ex= env->ExceptionOccurred() ) {
    env->ExceptionDescribe();
    env->ExceptionClear();
    sprintf(sbuf, "DLL: Cannot find class ChartFactory\n");
    printSBufViaJava(sbuf);
    return NULL;
    mid = env->GetStaticMethodID(chartFactoryClass, "getInstance", "()Lwschwendt/metastock/msx/ChartFactory;");
    if (ex= env->ExceptionOccurred() ) {
    env->ExceptionDescribe();
    env->ExceptionClear();
    sprintf(sbuf, "DLL: Cannot find method ID for ChartFactory.getInstance()\n");
    printSBufViaJava(sbuf);
    return NULL;
    jobject chartFactory=env->CallStaticObjectMethod(chartFactoryClass, mid);
    if (ex= env->ExceptionOccurred() ) {
    env->ExceptionDescribe();
    env->ExceptionClear();
    sprintf(sbuf, "DLL: Exception while calling ChartFactory.getInstance()");
    printSBufViaJava(sbuf);
    return NULL;
    mid = env->GetMethodID(chartFactoryClass, "getChartID", "(Ljava/nio/ByteBuffer;Ljava/nio/ByteBuffer;Ljava/nio/ByteBuffer;Ljava/nio/ByteBuffer;IIIIIII)F");
    if (ex= env->ExceptionOccurred() ) {
    env->ExceptionDescribe();
    env->ExceptionClear();
    sprintf(sbuf, "DLL: Cannot find method ID for ChartFactory.getChartID()\n");
    printSBufViaJava(sbuf);
    return NULL;
    jobject symbolBuf=env->NewDirectByteBuffer(a_psDataRec->pszSymbol, strlen(a_psDataRec->pszSymbol) );
    if (ex= env->ExceptionOccurred() ) {
    env->ExceptionDescribe();
    env->ExceptionClear();
    sprintf(sbuf, "DLL: Cannot allocate symbolBuf\n");
    printSBufViaJava(sbuf);
    return NULL;
    jobject securityNameBuf=env->NewDirectByteBuffer(a_psDataRec->pszSecurityName, strlen(a_psDataRec->pszSecurityName) );
    if (ex= env->ExceptionOccurred() ) {
    env->ExceptionDescribe();
    env->ExceptionClear();
    sprintf(sbuf, "DLL: Cannot allocate securityNameBuf\n");
    printSBufViaJava(sbuf);
    return NULL;
    jobject securityPathBuf=env->NewDirectByteBuffer(a_psDataRec->pszSecurityPath, strlen(a_psDataRec->pszSecurityPath) );
    if (ex= env->ExceptionOccurred() ) {
    env->ExceptionDescribe();
    env->ExceptionClear();
    sprintf(sbuf, "DLL: Cannot allocate securityPathBuf\n");
    printSBufViaJava(sbuf);
    return NULL;
    jobject securityOnlineSourceBuf=env->NewDirectByteBuffer(a_psDataRec->pszOnlineSource, strlen(a_psDataRec->pszOnlineSource) );
    if (ex= env->ExceptionOccurred() ) {
    env->ExceptionDescribe();
    env->ExceptionClear();
    sprintf(sbuf, "DLL: Cannot allocate onlineSourceBuf\n");
    printSBufViaJava(sbuf);
    return NULL;
    // Java Function call leads to crash, if console output is turned off and
    // the first statement in the Java routine is a (useless) string concatenation.
    // Otherwise it works stable.
    jfloat chartID=env->CallFloatMethod(chartFactory, mid, securityNameBuf, symbolBuf,
    securityPathBuf, securityOnlineSourceBuf, (jint)(a_psDataRec->iPeriod),
    (jint)(a_psDataRec->iInterval), (jint)(a_psDataRec->iStartTime),
    (jint)(a_psDataRec->iEndTime), (jint)(a_psDataRec->iSymbolType),
    (jint)firstDate, (jint)firstTime );
    if (ex= env->ExceptionOccurred() ) {
    env->ExceptionDescribe();
    env->ExceptionClear();
    sprintf(sbuf, "DLL: Exception while calling ChartFactory.getChartID()");
    printSBufViaJava(sbuf);
    return NULL;

  • How to use the t-code vf31 tor taking print out of invoice

    Hi,
      How to use the t-code vf31 for taking print out,am getting an error like no message for initial processing exist,
    venu

    Hi,
    Please find the steps
    Output type                     RD00
    Transmission medium             1
    Sort order                      01
    Processing mode                 1
    Please give the oppropriate fields,
    if the still error persists  check the configuration in NACE transaction code.
    thanks
    Kuntla

  • How to use the game centre for apple iPad mini

    How to use the game centre for apple iPad mini

    Here you go:
    Using Game Center on your Mac or iOS device - Apple Support

  • How to use the Calculated attibute in view object

    Hi,
    I have a view object query with the calculated attribute name as 'TRANCODE' in the below sql.This query works for the initial page loading.
    After the page gets loaded, there is a search section in the same page at the top.
    Here i will have to build the whereclause to the same query and retrieve the values.
    i am using jDeveloper 10.1.3.1, with adf and jHeadstart.
    Can some one tell as how to use the calculated attribute TRANCODE in whereclause?
    SELECT /*+ first_rows(10) */
    BatchCntl.FILE_CNTL_ID,
    CASE WHEN chk_bit(Entry.ENTRY_FLAGS, 2)='Y' OR Entry.ENTRY_SUBSTATUS = 'D' OR Entry.ENTRY_SUBSTATUS = 'J'
    THEN
    CASE eeh.TRAN_CODE
    WHEN '21' THEN 'C'
    WHEN '22' THEN 'C'
    WHEN '31' THEN 'C'
    WHEN '32' THEN 'C'
    WHEN '26' THEN 'D'
    WHEN '27' THEN 'D'
    WHEN '36' THEN 'D'
    WHEN '37' THEN 'D'
    ELSE eeh.TRAN_CODE
    END
    ELSE
    CASE Entry.TRAN_CODE
    WHEN '21' THEN 'C'
    WHEN '22' THEN 'C'
    WHEN '31' THEN 'C'
    WHEN '32' THEN 'C'
    WHEN '26' THEN 'D'
    WHEN '27' THEN 'D'
    WHEN '36' THEN 'D'
    WHEN '37' THEN 'D'
    ELSE Entry.TRAN_CODE
    END
    END AS TRANCODE,
    FROM Batch_Cntl BatchCntl, Entry, ENTRY_EDIT_HIST eeh
    WHERE (BatchCntl.BATCH_TYPE = 'E')
    AND (BatchCntl.BATCH_STATUS in ('A','D','R','P'))
    AND entry.in_batch_cntl_id = BatchCntl.BATCH_CNTL_ID
    and Entry.fi_rt = eeh.fi_rt (+)
    and Entry.entry_id = eeh.entry_id (+)
    AND (Entry.ENTRY_STATUS in ('A','D','R','P'))
    ORDER BY BatchCntl.BATCH_CNTL_ID, Entry.entry_id
    regards
    Raj.

    Let's say your application module is com.yourcompany.someapp.services.MyService, and let's say you authored a method like the following in the MyServiceImpl.java file:
      public void doSomething(int i, String s) {
      }and you exposed this AM custom method using the AM editor.
    BC4J design time will automatically create you the com.yourcompany.someapp.services.common.MyService interface that will look like this if you go look at the source code:
    package com.yourcompany.someapp.services.common;
    import oracle.jbo.ApplicationModule;
    public interface MyService extends ApplicationModule {
      public void doSomething(int i, String s);
    }To use your custom method from a client, just cast your ApplicationModule to your custom interface like this:
    import com.yourcompany.someapp.services.common.MyService;
      MyService mySvc = (MyService)yourAM;
      mySvc.doSomething(1,"foo");

  • How to use the validation work in Both TAB and Mouse keys in Forms6i

    Hi,
    I have a validation script once it's validated it should execute the query.But using When-Validate-Item i can't use execute_query.I am able to use the validation in Key-Next-Item trigger but if the user moves the cursor using mouse then it's not working.
    How to use the validation script working in Both Scenarios(Tab and Mouse keys).
    Can anyone please give inputs to rectify the above issue?.

    So you have multiple fields, but on at least one of them if it's valid you immediately want to execute the query?
    You could create a hidden field in a control block Query_Now default 'N'. In a WHEN-VALIDATE-ITEM on your item, if it's determined to be valid, then set Query_Now to 'Y'.
    In a WHEN-NEW-ITEM-INSTANCE at block level, check if Query_Now is 'Y'. If it is then execute the query (and set it back to 'N').

  • How to use the chart option in bex analyzer

    Hi Expert
    i want to know how to use the Chart in Bex Analyzer.
    Next week i hve End user Training. my user wanthow to use the chart option in Analyzer.
    plz let me know how to use chart & any Document on that plz reply me.
    Reagards
    siva
    Edited by: patel siva on Sep 16, 2008 4:34 PM

    Check here:
    https://reporting.uky.edu/BWBExContextMenu.pdf
    http://help.sap.com/saphelp_nw70/helpdata/EN/8b/4ffd9b07474279b3bbee75a60db41f/content.htm
    http://help.sap.com/erp2005_ehp_03/helpdata/EN/5b/30d43b0527a17be10000000a114084/frameset.htm
    Thanks..
    Shambhu

  • How to use the Combo Box In MAtrix Colums

    HI Experts,
    Good Mornong.How to use the Combo Box In MAtrix Colums?
    Regards And Thanks,
    M.Thippa Reddy

    hi,
    loading data in to the combobox on form load.but, it should be done when atleast one row is active.
    the values what ever you are inserting in to combo should  be less than or eqhal to 100 or 150.if it exceeds beyond that performance issue arises.it takes more time to load all the data.so, it is better to have 100 or less.
    oMatrix.AddRow()
    RS = Nothing
    RS = ocompany.GetBusinessObject(SAPbobsCOM.BoObjectTypes.BoRecordset)
    RS.DoQuery("select ItemCode,ItemName from oitm")
    oCombo = oMatrix.Columns.Item("ColumnUID").Cells.Item(oMatrix.RowCount).Specific
    For i = 1 To RS.RecordCount
          If RS.EoF = False Then
                oCombo.ValidValues.Add(RS.Fields.Item("ItemCode").Value,RS.Fields.Item("ItemName").Value)
                RS.MoveNext()
          End If
    Next
    the above code is inserting data from database to column combobox.
    you can fill combo directly also as shown below.
    oCombo.ValidValues.Add("x","1")
    oCombo.ValidValues.Add("y","2")
    oCombo.ValidValues.Add("z","3")
    oCombo.ValidValues.Add("","")
    and what ever the values you are filling into combo should be unique.other wise it shows valid value exists.
    regards,
    varma

  • How to use the Variants in SAP Transportation and what is its use ?

    Hi experts,
    How to use the Variants in SAP Transportation and what is its use & How to create a variant in SAP ?
    Can anybody answer this ?
    Regards,
    Shakti

    Hi,
    If you are asking about "slection vairants" in SPRO settings of "shipment cost document" then
    When it is activated,
    each user can have his own slecetion  and list criteria for
    1. List shippment costs:calculation
    2. List shippment costs: settlement
    This can be directly saved from VI01 screen by the user.
    from environment> lists
    This is user specific only.
    Hope this helps.
    Regards,
    Sharan

  • How to use the selection profile and status profile for production order?

    Hi expert,
       I want to know how to use the selection profile and status profile for production order. what's the usage for these two selection profile and status profile ?
      Please help me.
      thanks in advance.
      george.shi

    Hi George,
    There are are two types of statuses.One is system status and second one is user status.These statuses will tell us current situation of an order.
    We can't change system statuses.But we can create our own statuses through status profile.With this profile we can control user statuses.
    In this status profile,
    1.We define the sequence in which user statuses can be activated,
    2.We define initial statuses
    3. Allow or prohibit certain business transactions.
    Selection profiles are used to select the objects (say production orders) with different status combinations.We assign status profiles to selection profiles in BS42 T-Code.
    Regards,
    Raja.
    Edited by: Rajarao on Oct 30, 2008 6:21 AM
    Edited by: Rajarao on Oct 30, 2008 6:22 AM

Maybe you are looking for