Skip to Content

Replace all BSIK blank profit center values from Faglflexa

Dear All,

I have a requirement that all blank profit center values should be replaced from Faglflexa profit center .

SELECT *

INTO CORRESPONDING FIELDS OF TABLE GIT_BSIK

FROM BSIK

WHERE BUKRS = P_BUKRS

AND LIFNR = P_LIFNR

AND BUDAT IN SO_DATE

AND GSBER IN SO_GSBER .

SELECT DOCNR

RBUKRS

PRCTR

GJAHR

BELNR

BUZEI FROM FAGLFLEXA INTO TABLE IT_FAGLFLEXA FOR ALL ENTRIES IN GIT_BSIK

WHERE RBUKRS = GIT_BSIK-BUKRS

AND DOCNR = GIT_BSIK-BELNR

AND BUZEI = GIT_BSIK-BUZEI

AND RLDNR EQ '0L'

AND RRCTY EQ '0'

AND RVERS EQ '001'.

DATA : idx TYPE sy-tabix.

LOOP AT GIT_BSIK INTO GS_BSIK .

IDX = SY-TABIX.

READ TABLE it_faglflexa INTO WA_FAGLFLEXA with key RBUKRS = GS_BSIK-BUKRS BELNR = GS_BSIK-BELNR

BUZEI = GS_BSIK-BUZEI.

IF SY-SUBRC eq 0.

GS_BSIK-PRCTR = WA_FAGLFLEXA-PRCTR.

ENDIF.

MODIFY GIT_BSIK from GS_BSIK INDEX IDX TRANSPORTING PRCTR.

ENDLOOP.

I have used above code lines , can there be any other way to do this .

Regards

Deep

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

1 Answer

  • Posted on Aug 03, 2016 at 09:33 AM

    Hi.

    field-symbols: <fs1> type git_bsik

    Loop at git_bsik assining <fs1>

    READ TABLE it_faglflexa INTO WA_FAGLFLEXA with key RBUKRS = GS_BSIK-BUKRS BELNR = GS_BSIK-BELNR BUZEI = GS_BSIK-BUZEI.

    <fs1>-prct = your value.

    endloop.

    Add a comment
    10|10000 characters needed characters exceeded

    • Former Member Deep Bisht

      Hi

      Try to use the fiscal year in your selection:

      SELECT DOCNR RBUKRS PRCTR GJAHR

      BELNR BUZEI INTO TABLE IT_FAGLFLEXA

      FROM FAGLFLEXA

      FOR ALL ENTRIES IN GIT_BSIK

      WHERE RYEAR = GIT_BSIK-GJAHR

      AND DOCNR = GIT_BSIK-BELNR

      AND RLDNR = '0L'

      AND RBUKRS = GIT_BSIK-BUKRS

      AND BUZEI = GIT_BSIK-BUZEI

      AND RRCTY = '0'

      AND RVERS = '001'.

      of course you should check how many hits are in GIT_BSIK table

      Max

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.