Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

Abap related knowledge

Former Member
0 Likes
3,847

Hi Experts,

I am layman of this kind of Abap language.Now my job requires to understand these things also.As SD functional Consultant,I need to understand the following things.Can anybody guide me how to understand these kind of stuffs.

FORM KOBED_002.

SY-SUBRC = 4.

IF KOMP-KPOSN NE 0.

CHECK: KOMP-PRSFD CA 'BX'.

CHECK: KOMP-KZNEP = SPACE.

ENDIF.

SY-SUBRC = 0.

ENDFORM.

  • Prestep

FORM KOBEV_002.

SY-SUBRC = 0.

ENDFORM.

Regards

kumar

1 ACCEPTED SOLUTION
Read only

uwe_schieferstein
Active Contributor
0 Likes
2,381

Hello

Structure KOMP deals with the Pricing Communication Item. Below I have beautified the coding a little bit.

By default sy-subrc = 4 meaning that in the calling program this might trigger error handling or abortion of the execution. Or this item is excluded from further processing.

If, however, the item number is not zero (often header entries have item number = 0, i.e. we have a true item)

AND the "Carry out pricing" C ontains A ny 'BX' substring

AND the exclusion indicator is space (i.e. NOT excluded)

then set sy-subrc = 0.


*&---------------------------------------------------------------------*
*&      Form  KOBED_002
*&---------------------------------------------------------------------*
*       text
*----------------------------------------------------------------------*
FORM kobed_002.
  sy-subrc = 4.
  IF komp-kposn NE 0.  " Condition item number <> 0 (probably no header)
    CHECK: komp-prsfd CA 'BX'.  " Carry out pricing
    CHECK: komp-kznep = space.  " Condition exclusion indicator
  ENDIF.
  sy-subrc = 0.
ENDFORM.                                                    "KOBED_002
* Prestep
FORM kobev_002.
  sy-subrc = 0.
ENDFORM.                                                    "KOBEV_002

Regards

Uwe

Hi Experts,

I am layman of this kind of Abap language.Now my job requires to understand these things also.As SD functional Consultant,I need to understand the following things.Can anybody guide me how to understand these kind of stuffs.

FORM KOBED_002.

SY-SUBRC = 4.

IF KOMP-KPOSN NE 0.

CHECK: KOMP-PRSFD CA 'BX'.

CHECK: KOMP-KZNEP = SPACE.

ENDIF.

SY-SUBRC = 0.

ENDFORM.

  • Prestep

FORM KOBEV_002.

SY-SUBRC = 0.

ENDFORM.

Regards

kumar

5 REPLIES 5
Read only

uwe_schieferstein
Active Contributor
0 Likes
2,382

Hello

Structure KOMP deals with the Pricing Communication Item. Below I have beautified the coding a little bit.

By default sy-subrc = 4 meaning that in the calling program this might trigger error handling or abortion of the execution. Or this item is excluded from further processing.

If, however, the item number is not zero (often header entries have item number = 0, i.e. we have a true item)

AND the "Carry out pricing" C ontains A ny 'BX' substring

AND the exclusion indicator is space (i.e. NOT excluded)

then set sy-subrc = 0.


*&---------------------------------------------------------------------*
*&      Form  KOBED_002
*&---------------------------------------------------------------------*
*       text
*----------------------------------------------------------------------*
FORM kobed_002.
  sy-subrc = 4.
  IF komp-kposn NE 0.  " Condition item number <> 0 (probably no header)
    CHECK: komp-prsfd CA 'BX'.  " Carry out pricing
    CHECK: komp-kznep = space.  " Condition exclusion indicator
  ENDIF.
  sy-subrc = 0.
ENDFORM.                                                    "KOBED_002
* Prestep
FORM kobev_002.
  sy-subrc = 0.
ENDFORM.                                                    "KOBEV_002

Regards

Uwe

Read only

0 Likes
2,381

Can you do this for all the SAP ABAP code...

Read only

0 Likes
2,381

SAP code (?) that is setting system field sy-subrc by hand, arrgh.

Nobody can guarantee that it is not overridden by the system and nobody would expect that a dang form is setting it ...


Guideline and Guideline ...

Read only

former_member873340
Active Participant
0 Likes
2,381

FORM KOBED_002. = This is called by a subroutine starting with perform KOBED_002.

SY-SUBRC = 4. > Indicates a failure in any of the step processed above the statement.

IF KOMP-KPOSN NE 0. > KOMP-KPOSN not equal to zero.

CHECK: KOMP-PRSFD CA 'BX'. if komp-prsfd contains any text having BX.

SY-SUBRC = 0. Indicates a success in any of the step processed above the statement.

ENDFORM.

Revert if you any more doubts.

Award points if helpful.

Regards,

Gowri.

Read only

brusa
Discoverer
0 Likes
2,381

Es scheint so aber nicht im EHP8 zu funktionieren.lnachweise ==== Weblinks ==