Regarding BDC session to run immediately after creation

Hi Abapers,
Please help me out from the following situation.
I need to run the BDC session immediately after creating. I beleive using RSBDCSUB we can achieve it.
If it so please let me know how can we use this.....
Please let me know if any other solutions.
Thanx in advance.
will reward with points for the usefull answers.

Hi Sir ,
Please have a look below .Hope it is suitable and simpler solution for your question.
Please do reward if useful.
Thankx.
If user want BDC in foreground use a CALL TRANSACTION and don't create a BDC butt fill a BDCDATA structure table and then
codeCALL TRANSACTION 'transaction' USING itab[/code]
You can specify the way to process in OPTIONS and MODE parameters.
Look at
Using CALL TRANSACTION USING for Data Transfer
something like
if foreground is initial.
BDC_OPEN_GROUP
endif.
fill bdcdata
if foreground is initial.
BDC_INSERT
BDC_CLOSE_GROUP
SUBMIT RSBDCSUB WITH MAPPE = group_name
else.
CALL transaction USING data MODE mode.
endif.
CODE  --->
code
DATA : w_nom TYPE apq_grpn ,
w_kbetr(16) ,
w_datab(10) ,
w_datbi(10) ,
w_kpein(5) ,
w_kmein(3) .
CHECK is_data-flag EQ 'A' OR
is_data-flag EQ 'B' OR
is_data-flag EQ 'C'.
REFRESH itg_bdcdata.
Batch-input name.
CONCATENATE 'Hauss_'
sy-uzeit
is_data-knumh+4(6)
INTO w_nom.
Open Batch-input.
PERFORM p_open_bdc USING w_nom.
Choix type cond.
PERFORM p_bdc_dynpro USING 'SAPMV13A'
'0100'.
PERFORM p_bdc_field USING 'BDC_OKCODE'
'=ANTA'.
PERFORM p_bdc_field USING 'RV13A-KSCHL'
gw_kschl.
Choix de la clef.
PERFORM p_bdc_dynpro USING 'SAPLV14A'
'0100'.
PERFORM p_bdc_field USING 'BDC_OKCODE'
'=WEIT'.
PERFORM p_bdc_field USING 'RV130-SELKZ(01)'
'X'.
Enregistre la nouvelle condition.
PERFORM p_bdc_dynpro USING 'SAPMV13A'
'1510'.
PERFORM p_bdc_field USING 'BDC_OKCODE'
'=SICH'.
PERFORM p_bdc_field USING 'KOMG-VKORG'
is_data-vkorg.
PERFORM p_bdc_field USING 'KOMG-VTWEG'
is_data-vtweg.
PERFORM p_bdc_field USING 'KOMG-KUNNR'
is_data-kunnr.
PERFORM p_bdc_field USING 'KOMG-MATNR'
is_data-matnr.
PERFORM p_bdc_field USING 'KOMG-WERKS'
is_data-werks.
PERFORM p_bdc_field USING 'KOMG-AUART_SD'
is_data-auart_sd.
PERFORM p_bdc_field USING 'KOMG-INCO1(01)'
is_data-inco1.
WRITE is_data-kbetr2 TO w_kbetr.
PERFORM p_bdc_field USING 'KONP-KBETR(01)'
w_kbetr.
WRITE is_data-kpein TO w_kpein.
PERFORM p_bdc_field USING 'KONP-KPEIN(01)'
w_kpein.
WRITE is_data-kmein TO w_kmein.
PERFORM p_bdc_field USING 'KONP-KMEIN(01)'
w_kmein.
WRITE is_data-datab TO w_datab.
PERFORM p_bdc_field USING 'RV13A-DATAB(01)'
w_datab.
WRITE is_data-datbi TO w_datbi.
PERFORM p_bdc_field USING 'RV13A-DATBI(01)'
w_datbi.
Save the transaction.
PERFORM p_insert_bdc USING 'VK11'.
Close the Batch-input..
PERFORM p_close_bdc.
COMMIT WORK AND WAIT.
SUBMIT rsbdcsub WITH mappe = w_nom
WITH von = sy-datum
WITH bis = sy-datum
EXPORTING LIST TO MEMORY
AND RETURN.[/code]

Similar Messages

  • OTR CREATION IN BATCH MODE / AUTOMATIC "CIF" CUSTOMER IMMEDIATELY AFTER CREATION IN ECC

    Dear All,
    My scenario is: We have a Web dynpro customized screen for Customer Creation and Sales Order creation in SAP ECC. This screen first send data to CRM where Customer is created and Customer code is flowing back to my screen immediately. Using this Customer Code, Sales order is created from the same screen using standard BAPI.
    Now as per standard behavior, data will be sent to TM immediately after sales order creation for OTR creation, where it will fail as customer created was not CIFed to TM. So as per my understanding, my issue can be resolved by any of the following ways:
    Option 1) Automatic CIF customer at the time of Customer Creation: By this if customer will automatically CIFed to TM immediately after the customer is created in ECC through CRM, then there will be no issue even in creating OTR immediately after Sales order creation.
    OR
    Option 2) Creating OTR in batch mode instead of immediately after Sales Order Creation: By this I can first CIF Customer to TM in Batch JOB and then subsequently OTR will be created in Batch Job.
    Please suggest more feasible option out of two options mentioned above and also how to achieve the same?
    Regards,
    Vibhu Gupta

    Hi Vikas,
    1. Could you please show me one of your FU stages info if allowed and show me what you did to achieve step 4 and 5 in the frontend? I want to check in our internal system and see whether this can be achieved from standard point.
    2. How did you achieve the automatic FO creation when building FU? Because when I create a FU, there is no FO created automaticaly.
    Thanks & Best Regards,
    Dawson

  • Regarding bdc for automatic run

    hi experts,
                    i have developed a bdc for hr in which the data is uploading from the excel sheet,what my user wants that this report will run automatically at 11 pm every day so for this send me the steps for this i know i have to exceute it in the background but how plz help me ...
    ***plz dnt send me the url come up with your own answer....
    thnx in advance.....

    Hi RAVI,
    if u've created the BDC in call transaction method, then create a variant for the selection screen with the relevant data. and create a scheduled job from SM36.
    in case of session: u need to schedule the two programs in SM36.
    1st the bdc program to create the session and next the program RSBDCSUB with variants. in case of scheduling RSBDCSUB session name & other details should be saved in the variants.
    Reward if useful
    Regards
    ANUPAM

  • Access NAST table immediately after creation of sales order (va01)

    Hi All,
    I want to access the nast data for the newly created sales order from va01. I tried to use program exits:
    userexit_save_document and userexit_save_documnr_prepare
    and plu the BADI BADI_SD_V46H0001 method EXIT_SAPLV46H_003.
    the breakpoint is not stoping there even if I have given.
    Please suggest any enhancements are there for such functionality.
    The flow is like this.:
    when user clicks on the save button after entering the data for sales order creation, the email/fax will be send to the contact persons for the output type and I want to update the nast table DATVR entry so that it will be marked as processed entry.
    rgds
    Madhuri

    I am not sure what you want, but I think it is not  the right way to realize the flow.
    When a sales order is saved, the process of issuing output will be handled by another program RSNAST00 (T_CODE: WE15)immediately or via a scheduled job due to output configuration , and the nast table will be updated at the same time. i think there is no need to update the nast table by yourself.

  • Regarding BDC session

    Hi
    i am processing my BDC pro. in Session method.
    my requirement is i have to capture the error records into a file
    and i have to write that file on appl. server.
    how to capture the error records from error log?
    please reply

    Hai  Saritha,
    Usually if there are any errors in CALL TRANSACTION we send those records to SESSION METHOD by using below logic.
    eg:
    CALL TRANSACTION 'XK01' USING
    t_bdcdata MODE 'N' .
    IF sy-subrc 0.
    PERFORM session_bdc.
    ENDIF.
    ENDLOOP.
    IF s_flag = 'X'.
    CALL FUNCTION 'BDC_CLOSE_GROUP'.
    ENDIF.
    This is subroutine .
    FORM session_bdc .
    IF s_flag = ' '.
    CALL FUNCTION 'BDC_OPEN_GROUP'
    EXPORTING
    client = sy-mandt
    group = 'vcentric'
    holddate = filler8
    keep = 'X'
    user = sy-uname
    prog = sy-cprog.
    s_flag = 'X'.
    ENDIF.
    CALL FUNCTION 'BDC_INSERT'
    EXPORTING
    tcode = 'XK01'
    TABLES
    dynprotab = t_bdcdata.
    ENDFORM. " SESSION_BDC
    or we can send the error records on into an flat file by using the below logic.
    CALL TRANSACTION 'XK01' USING
    T_BDCDATA MODE 'N' MESSAGES INTO T_BDCMSG.
    IF SY-SUBRC 0.
    APPEND W_UPLOAD TO T_ERROR.
    ENDIF.
    CLEAR W_BDCMSG.
    READ TABLE T_BDCMSG INTO W_BDCMSG INDEX 1.
    CLEAR L_MSG.
    CALL FUNCTION 'FORMAT_MESSAGE'
    EXPORTING
    ID = W_BDCMSG-MSGID
    LANG = SY-LANGU
    NO = W_BDCMSG-MSGNR
    V1 = W_BDCMSG-MSGV1
    V2 = W_BDCMSG-MSGV2
    V3 = W_BDCMSG-MSGV3
    V4 = W_BDCMSG-MSGV4
    IMPORTING
    MSG = L_MSG
    EXCEPTIONS
    NOT_FOUND = 1
    OTHERS = 2.
    IF SY-SUBRC = 0.
    WRITE:/ W_UPLOAD-NAME1, '----', L_MSG.
    ENDIF.
    ENDLOOP.
    this is subroutine.
    FORM ERROR_RECORDS .
    CALL FUNCTION 'GUI_DOWNLOAD'
    EXPORTING
    FILENAME = 'C:/ERROR.TXT'
    FILETYPE = 'ASC'
    WRITE_FIELD_SEPARATOR = 'X'
    TABLES
    DATA_TAB = T_ERROR.
    ENDFORM. " ERROR_RECORDS
    Reward is useful.
    Regards.
    Eshwar.

  • How to trigger an SMS after creation of Activity / Interaction Record

    Dear Experts,
    Our Client requirement is to trigger an SMS immediately after creation of an Interaction Record. I want to define an Action for this.
    But what processing type should I use for SMS, (like Method Call, Smart Forms Mail / Fax / Print and Workflow). We are using an external service provider domain to send SMS to our customers. It has been configured in SCOT.
    But from CRM configuration front there is no specific processing type for SMS. then how system reads telephone number from the BP master.
    Kindly help me to resolve the issue, your suggestions will be highly appreciated.
    Best regards
    Raghu ram

    Raghu,
    In your case you could copy a "print" action method class and create a z-version.  Then modify the print action method so that the smartform output triggers a call to your output type.
    Or you could just code a new method that creates a new BCS send request using the CL_BCS document and your output type.
    It just depends on how whether you want to use smartforms to build the message or build it in some other method.
    Take care,
    Stephen

  • BDC Sessions and Subscreens

    I have recorded a transaction using the transaction recorder (Transation LT0E); there is a subscreen on one of the screens.
    If I do not enter data in the subscreen (i.e. leave the proposed defaults), then when I play back the recording, it works fine. However, if I change the data in the subscreen and play that recording back, it fails; the little window that shows what the current command being executed is just disappears.
    If I turn the recording into a BDC session and run that, it records the error "No batch input data for screen SAPML03T 0105".
    Anybody have a clue what is happening here?

    Yes, thanks, that is what is happening; I am deleting a field which when the enter button is pressed is then re-calculating that field with a new value.
    Found a workaround for it.
    Cheers,
    Tony.

  • Run command after current command finishes?

    I use zsh, but bash-compatible would be nice.
    I know I can do command1 && command2.
    Is it possible to start command1, realise it's going to take a while to complete, but specify a job to run immediately after it finishes (presumably successfully)?
    i.e., I want to run command1 && command2, at the point that I've started command1 on its way and forgot I wanted to specify command2.
    Or is this not possible?
    Thanks guys.

    karol wrote:
    brisbin33 wrote:
    i still think he wants command2 to wait for command1 to finish.  i'd use similar job control plus a small function (which could live in bashrc if you do this sort of thing often):
    //blue/0/~/ when_done() { while true; do ps $1 &>/dev/null || return 0; done; }
    //blue/0/~/ sleep 20
    ^Z
    [1]+ Stopped sleep 20
    //blue/148/~/ bg
    [1]+ sleep 20 &
    //blue/0/~/ jobs -l
    [1]+ 30771 Running sleep 20 &
    //blue/0/~/ when_done 30771 && echo 'command2'
    [1]+ Done sleep 20
    command2
    //blue/0/~/
    But it's tied to a PID, so if command1 actually means 'commandA && commandB', that will fail, won't it?
    /edit:
    I think you're right; after some CLI testing, it seems both my over-complicated way and Procyon's identical simpler solution (I misread his initially ) will fail in the case of two initial commands.
    //blue/0/~/ sleep 10 && sleep 10
    ^Z
    [1]+ Stopped sleep 10
    //blue/148/~/ fg; echo yay
    sleep 10
    yay
    but i don't think that was the original question, was it?
    Last edited by brisbin33 (2010-09-07 17:07:31)

  • Need to run the BDC job immediately after XK02 is saved.

    Hi all.
        I have to trigger a batch job (BDC program) after changing the customer thru xk02 TRANACTION.
    I found one exit EXIT_SAPMF02K_001 which checks before saving. But my requirement is job (BDC prog) should run after saving. So I guess its of no use. Do we have any BADI ( method)....?Can you pls let me know how to procede.
    If workflow is the solution...
    I have run the event traces by transaction code swel & sels, I could not find any event triggering to tigger the workflow  ( to perform background task) Do I need to create Change document & BOR for acheiving this thru workflow .
    Cheers,
    sami.

    Hi Neha.
           Thanks for quik turn around. But I need this z program to run after all changes are done in XK02 because I need to use the changed vendor data in the BDC program. This is the exit which triggers before save, so I couldn't get the changed vendor data from database table to use in z program (BDC).
    Hope I am clear.
    Cheers,
    sami.

  • Incorrect state of bdc-sessions after system-termination

    Hello,
    following situation:
    I've run 8 bdc-sessions and system breaks down becaus of to less table space.
    After correction of table space and activating update (sm13)
    the job's go on.
    But 2 bdc-sessions have a false state - they show processing but sm50 and log shows that they do nothing. The creation of customers is not complete (only 50 %). How can I correct the state of the bdc-sessions and process the jobs further???
    1 BDC is finished but the state is false too (processing) How can i correct the state of tht session ?=
    thanks and regaards
    Andreas

    Good morning Rob,
    I've tried to release it but I get the following "false" message:
    Could not release folder "MIARMD_1029"  since it still contains a background job
    Message no. 00299
    -> there's no background job any longer!
    any ideas except creating new bdc-sessions???
    thx and greetings
    Andreas Mann

  • Auto transfer order session immediately after saving delivery in vl01n

    Hi all,
    Auto transfer order session immediately after saving delivery in vl01n  means when do the delivery with vl01n system should open LT03 t.code session on the same session , how to achieve this please advice me.
    Regards,
    Krishna

    Hi Krishna,
    Please have a look at the SAP note 566090 FAQ for immediate transfer order creation, this note give you some explanation about immediate TO creation...
    Regards,
    Mauro

  • Storing of log file in A/P Server while running BDC session in SM35

    Hi All,
    I have issue when running BDC session in SM35.
    The actual issue is
    I need to store of log file generated while running BDC session in <b>SM35</b> in <b>Application/Presentation</b> Server path.
    When ever we run single session the Log file regarding that session we need to store in Application/Presentation Server.
    Can anybody have solution for this issue.
    Thanks in advance.
    Thanks & Regards,
    Rayeez.

    Hi
    See the std report RSBDC_ANALYSE, here you can know how to find out the log of B.I..
    You can create a program like that to load the log into file instead of showing it.
    Max

  • Photoshop Elements 13 running in Windows 8.1 hangs immediately after starting

    Photoshop Elements 13 running in Windows 8.1 hangs immediately after starting.  Has to be shut down by Task Manger.  Task Manger shows that it is still using some CPU.  Ran Procmon (part of Sysinternals) which shows that it is in a loop.   Stack trace shows it is executing code in AMTValidateProductLicense.dll.  Started happening about a month after I installed PSE.  Everything used to work fine at first.  Have tried going back to an old image of Win 8.1 on a different hard drive, otherwise same computer, and installed PSE 13 from DVD.  That installation never worked, it aways hangs.  If I do a clean boot, it sometimes runs long enough for me to click on a menu item and then hangs the same way.  And, yes I bought a new DVD to run on this computer, never been used in any other way.  Any ideas how I can get PSE running properly?

    It really doesn't look like a licensing issue, it seems to be code in the area of license validation that isn't working.
    I took your suggestion and initiated a couple of chat sessions with support, but so far still no luck.  The latest session with Neeraj seemed to be promising.  After some investigation he asked to reinstall.  First he uninstalled with Revo Uninstall, which seemed to be pretty thorough.  That required a restart, so he set things up to restore his conference session and took my phone number.  Unfortunately I guess his connection didn't come back.  When I didn't hear from him after a couple of hours I tried installing Photoshop and Premiere myself.  As before, Premiere works and Photoshop doesn't.  When I start Photoshop, the window opens and for a couple of seconds menus open when I click on them.  Then the window freezes and I have to use Task Manager to kill it.  So basically, I've tried several things but I'm back where I've been all along, I can't get Photoshop to work.  I'd really appreciate suggestions about something else to try.
    I wish someone at Adobe was interested in the Process Monitor traces I've made, because I'm sure someone who knows the code would be able to figure out pretty quickly what's happening.  Is it trying to read a file that's not there, failing to write a file, failing to make an internet connection or what?  It really shouldn't be this hard to figure out.

  • How to run the BAPI after creation or Modification ?

    HI Abapers,
    How to run the BAPI after creation or Modification ? What is the step by step procedure to run the the BAPI?
    Immediate reply is highely appriciable.
    Regards,
    Chow.

    Hi
    If you have done with BAPI creation correctly Run it similar to the fun mdule which we run in SE37 calling this BAPi in the program with CALL FUNCTION and passing the necessary parameters
    see the sample bapi code how it is called in Program
    data : w_resb_header like bapirkpfc.
    data: begin of itab_resb occurs 0.
    include structure bapiresbc.
    data: end of itab_resb.
    data: begin of itab_bapi_return occurs 0.
    include structure bapireturn.
    data: end of itab_bapi_return.
    data : w_resb_no like bapirkpfc-res_no.
    w_resb_header-plant = p_werks.
    w_resb_header-res_date = sy-datum.
    w_resb_header-created_by = sy-uname.
    w_resb_header-cost_ctr = '0000010001'.
    w_resb_header-move_type = '201'.
    w_resb_header-gr_rcpt = w_room_time.
    w_resb_header-part_acct = 'OR'.
    *ITEM DATA
    loop at i_details.
    itab_resb-material = i_details-matnr.
    itab_resb-plant = i_details-werks.
    itab_resb-store_loc = i_details-lgort.
    itab_resb-quantity = i_details-qty.
    itab_resb-unit = i_details-meins.
    append itab_resb.
    clear itab_resb.
    clear i_details.
    endloop.
    call function 'BAPI_RESERVATION_CREATE'
    exporting
    reservation_header = w_resb_header
    NO_COMMIT =
    MOVEMENT_AUTO =
    importing
    reservation = w_resb_no
    tables
    reservation_items = itab_resb
    return = itab_bapi_return
    call function 'BAPI_TRANSACTION_COMMIT'
    exporting
    wait = 'X'
    IMPORTING
    RETURN =    .
    wait up to 5 seconds.
    w_resb_no contains your reservations numnber
    Regards
    Anji

  • I'm using a macbook pro, running snow leopard. Yesterday I got around to emptying my trash for the first time in quite awhile and was surprised by how much there seemed to be in there. Immediately after a question mark symbols appeared on all my hard disk

    I'm using a macbook pro, running snow leopard. Yesterday I got around to emptying my trash for the first time in quite awhile and was surprised by how much there seemed to be in there. Immediately after a question mark symbol appeared on all my hard disk folders. If I click on these question marks I get a message saying ' the item can't be found'.

    mpagan47 wrote: a question mark symbol appeared on all my hard disk folders.
    Not sure where these hard disk folders are located that you are referring to?  Finder, Finder tool bar, Finder side bar, Desktop, Dock? 
    More then likely they are  an alias that not longer point to the orginals,  thus the question mark.
    I would reboot.  Delete icons if an alias and just recreate by dragging from the source. Try right click (control) click to remove.

Maybe you are looking for