Skip to Content
author's profile photo
Former Member

Update BSEG field

Hi All,

I want to update a z.. field which was being added by someone..

Problem is I can not do it through BDC..there is some problem in doing so...it will bit more work I already tried it.

I am looking for a FM or BAPI through which I can update field. Field is "Basline date".

Is there any update module for BSEG entries.

Looking for your ideas...

Thanks,

Mark

Add comment
10|10000 characters needed characters exceeded

  • Follow
  • Get RSS Feed

4 Answers

  • Posted on Dec 01, 2008 at 10:29 AM

    Hi,

    Refer Below code

    &----


    *& Form SUB_READ_UPDATE_BSEG

    &----


    text

    -


    FORM sub_read_update_bseg.

    IF NOT it_final[] IS INITIAL.

    LOOP AT it_final INTO wa_final.

    UPDATE bseg SET zuonr = wa_final-ccnum

    WHERE bukrs EQ wa_final-bukrs

    AND belnr EQ wa_final-vbeln

    AND rfzei EQ wa_final-rfzei

    AND saknr NE ' '.

    ENDLOOP.

    *--Message data updated successfully

    MESSAGE i888 WITH text-002.

    LEAVE LIST-PROCESSING.

    ELSE.

    *--Message No data found

    MESSAGE i888 WITH text-003.

    LEAVE LIST-PROCESSING.

    ENDIF.

    ENDFORM. " SUB_READ_UPDATE_BSEG

    Regards,

    Prashant

    Add comment
    10|10000 characters needed characters exceeded

    • Former Member

      >

      > UPDATE bseg SET zuonr = wa_final-ccnum

      > WHERE bukrs EQ wa_final-bukrs

      > AND belnr EQ wa_final-vbeln

      > AND rfzei EQ wa_final-rfzei

      > AND saknr NE ' '.

      Prashant - this is extremely dangerous code and should never be attempted. There are many other tables that have to be kept in synch with BSEG. Doing something like this may break an SAP system and cost more money to fix than any of us make.

      Additionally, it's incorrect. You are not using all the key fields in the WHERE of the UPDATE, so the wrong records could be changed.

      Rob

      Edited by: Rob Burbank on Dec 1, 2008 11:15 AM

  • author's profile photo
    Former Member
    Posted on Dec 01, 2008 at 10:47 AM

    hi

    try this code

    DATA: BEGIN OF ITAB2 OCCURS 0,

    BELNR LIKE BSEG-BELNR,

    BURKS LIKE BSEG-BURKS,

    GJAHR LIKE BSEG-GJAHR,

    WRBTR LIKE BSEG-WRBTR.

    DATA: END OF ITAB2.

    DATA: WA_WRBTR TYPE BSEG-WRBTR,

    WA_COUNT TYPE I.

    SELECT BELNR BURKS GJAHR WRBTR

    INTO TABLE ITAB2

    FROM BSEG

    FOR ALL ENTRIES IN ITAB1

    WHERE BELNR = ITAB1-BELNR

    AND BURKS = ITAB1-BURKS

    AND GJAHR = ITAB1-GJAHR.

    LOOP AT ITAB2.

    WA_WRBTR = WA_WRBTR + ITAB2-WRBTR.

    WA_COUNT = WA_COUNT + 1.

    ENDLOOP.

    WRITE: / 'TOTAL BSEG-WRBTR:', WA_WRBTR,

    'TOTAL COUNT:', WA_COUNT.

    hope this helps

    regards

    Aakash Banga

    Add comment
    10|10000 characters needed characters exceeded

  • author's profile photo
    Former Member
    Posted on Dec 01, 2008 at 03:30 PM

    Hi ,

    BSEG is not an independent table that can be updated.

    This table holds important information and is linked to many other tables.

    Check for any standard transactions through which using any provisions available update BSEG.

    Regards

    Raj

    Add comment
    10|10000 characters needed characters exceeded

  • author's profile photo
    Former Member
    Posted on May 03, 2011 at 11:41 AM

    This message was moderated.

    Add comment
    10|10000 characters needed characters exceeded