Skip to Content
avatar image
Former Member

Preparing Buffers

Hi experts,

What is ment by preparing BUffers.

I have a scnario in CRM like this:

DATA: GV_SOLDTO_GUID_LAST TYPE BAPIBUS1006_HEAD-PARTNERGUID.

P_BP_SOLDTO_GUID TYPE BAPIBUS1006_HEAD-PARTNERGUID

  • check at first if the buffers are prepared this is the case

  • if the gv_soldto_guid_last is not initial and equal the soldto

IF GV_SOLDTO_GUID_LAST IS INITIAL OR

P_BP_SOLDTO_GUID NE GV_SOLDTO_GUID_LAST.

CLEAR LS_RETURN.

MESSAGE E124(CRM_ISALES_BP) INTO LS_RETURN-MESSAGE.

LS_RETURN-ID = SY-MSGID.

LS_RETURN-NUMBER = SY-MSGNO.

LS_RETURN-TYPE = SY-MSGTY.

APPEND LS_RETURN TO MESSAGES.

RETURNCODE = GC_ERR_ABORT_EXECUTION.

EXIT.

ENDIF.

When i debug this the GV_SOLDTO_GUID_LAST is always initial Were as P_BP_SOLDTO_GUID has a value.

So it is printing error message E124.

Can any body suggest me here what is check at first if the buffers are prepared

Thanks in Advance.

Add comment
10|10000 characters needed characters exceeded

  • Follow
  • Get RSS Feed

1 Answer

  • Best Answer
    May 17, 2006 at 08:51 AM

    Hi Jak,

    Buffering : Buffering refers to executing a number of tasks and then finally do a single commit for the whole set of tasks.

    Say, for e.g. we create business partner using BAPI_BUPA_CREATE_FROM_DATA we don't commit here, we get a partner number from this BAPI and then we assign a role to it using BAPI_BUPA_ROLE_ADD we still don't commit, we then add the address for the partner using BAPI_BUPA_ADDRESS_ADD then we call BAPI_TRANSACTION_COMMIT for the whole set of tasks.

    <b>Please reward points if it helps.</b>

    Regards,

    Amit Mishra

    Add comment
    10|10000 characters needed characters exceeded

    • Former Member Amit Mishra

      Hi,

      Thanks for your efforts.

      this is the code of one standard FM CRM_ISA_SHIPTO_ADD_TO_BASKET in CRM.

      i have to analize this FM.

      1.See there is a variable GV_SOLDTO_GUID_LAST which is declared using data statement.It is refering a Structure field.

      2.There is one more variable P_BP_SOLDTO_GUID .This has a value. ie..this value i give when i exicute FM.

      So obesreve this code.

      • check at first if the buffers are prepared this is the case

      • if the gv_soldto_guid_last is not initial and equal the soldto

      IF GV_SOLDTO_GUID_LAST IS INITIAL OR

      P_BP_SOLDTO_GUID NE GV_SOLDTO_GUID_LAST.

      CLEAR LS_RETURN.

      MESSAGE E124(CRM_ISALES_BP) INTO LS_RETURN-MESSAGE.

      LS_RETURN-ID = SY-MSGID.

      LS_RETURN-NUMBER = SY-MSGNO.

      LS_RETURN-TYPE = SY-MSGTY.

      APPEND LS_RETURN TO MESSAGES.

      RETURNCODE = GC_ERR_ABORT_EXECUTION.

      EXIT.

      ENDIF.

      When i debug the above code the value of GV_SOLDTO_GUID_LAST is always initial.

      and P_BP_SOLDTO_GUID has value.So the above if condition is true and it enters the IF condition and prints the error message E124 and it won't proceed furthur and goes to the end of function.

      Observe the comments.

      I don't know why the have written this piece of code.

      I think you got now what i am asking..

      If you undersatnd pls give some suggessions.

      Thanks in Advance.