Skip to Content
author's profile photo Former Member
Former Member

ZF13E -- BSEG Fetch and Update not happening

Dear all

Our Customer has copied program SAPF124(TCode F13E) to Z version ZSAPF124( TCode Z13E).

Customer has maintained some additional Z fields(through coding blocks) in the BSEG.

So the Source difference in the Program has additional:

SELECT statement(from BSEG) and UPDATE BSEG with the Values for the Z fields as shown below:

*  update assignment and other data in clearing documents on BSEG       
        SELECT * FROM bseg INTO ls_bseg WHERE bukrs = lv_bukrs
                                          AND   belnr = lv_augbl.

            UPDATE bseg SET valut      = ls-valut     
                            zuonr      = lv-zuonr
                            z1         = ls-z1    
                            zz2        = ls-zz2
                            zz3        = ls-zz3
                            zz4        = ls-zz4
                            zz5        = ls-zz5
                            zz6        = ls-zz6
                            zz7        = ls-zz7
                            zz8        = ls-zz8
                            zz8        = ls-zz8
              WHERE bukrs = ls_bseg-bukrs
              AND   belnr = ls_bseg-belnr
              AND   gjahr = ls_bseg-gjahr
              AND   buzei = ls_bseg-buzei.

          ENDSELECT.

The program works very well in the Development System but in Quality this SELECT and UPDATE does not works as expected. SELECT raises sy-subrc = 4. But I can see the same document being present in the SE16->BSEG->belnr.

Please advice as this issue is very critical for us.

Cheers

RJ

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

5 Answers

  • author's profile photo Former Member
    Former Member
    Posted on Feb 27, 2009 at 08:12 AM

    Hi Remo.

    Take care while using the cluster table like BSEG.

    if you are using teh cluster table you need to pass all the primary keys to the where condiion other wise it wont select all the data from the database level.

    so use below fileds in the where condiion of select query.

    BUKRS

    BELNR

    GJAHR

    BUZEI

    hope it works.

    Regards!

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Feb 27, 2009 at 08:13 AM

    Try to use this conversion exit "CONVERSION_EXIT_ALPHA_INPUT" for variable lv_augbl.

    Call this function before use in the select statement.

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Feb 27, 2009 at 08:16 AM

    i think in the debugging mode you just check the where condition.....the data is not matching properly...and it gives sy-subrc = 4

    The SELECT statement sets sy-subrc to 4 if the result set is empty, that is, if no data was found in the database.

    check it.....

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Feb 27, 2009 at 08:21 AM

    1.Before Selecting from BSEG ,ensure lv_bukrs AND lv_augbl IS NOT INITIAL (Gjahr ahould also be passed while selecting from BSEG ).

    2.Before updating BSEG better to do the sy-subrc check.

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Feb 27, 2009 at 02:53 PM

    I think this whole process is very dangerous. What happens to the related tables like BSIS?

    Rob

    Add a comment
    10|10000 characters needed characters exceeded

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.