cancel
Showing results for 
Search instead for 
Did you mean: 

Credit Check on Program RVADOR01

Former Member
0 Kudos

What code should I add in program RVADOR01 so the order confirmation message is not printed when credit block is active?

Sales Reps are creating message manually before credit is approved and its giving us trouble.

This is the code on the procedure:

23 * Do not print if there is a credit hold

24 if komkbv1-cmgst ca 'BC'.
25 sy-subrc = 4.
26 exit.
27 endif.
28 endform.

If someone can help, thank you.

Carlos

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

I copied program RVADOR01 to a Z and now I see that credit status is in field VBUK-CMGST, but when I enter this on an IF statement in the FORM GET_DATA it does not have any value.

How can I get the value of field VBUK-CMGST from FORM GET_DATA on program RVADOR01?

Thank you, Regards,

Carlos

Former Member
0 Kudos

If you think that would help your situation, why not read table VBUK with your sales document number, via Open SQL SELECT? Why are the Sales Rep(s) doing this not getting appropriate correction or action? You're going to attempt to code for bad behavior? Why use Z version? Did you look at enhancing the subroutine first....

Former Member
0 Kudos

Thank you BreakPoint, I was just thinking that about Sales reps.

This is what I got but not getting any value:

FORM GET_DATA.

  DATA: w_obj type nast-objky,
              p_vbeln TYPE vbeln.

  break-point.

  SELECT SINGLE objky FROM nast INTO w_obj WHERE objky = p_vbeln. 

* ???? 

  IF VBUK-CMGST = 'B'.
    RETCODE = 1.
    break-point.
    EXIT.
  ENDIF.

Regards,

Carlos

Edited by: Carlos Salazar on Apr 1, 2011 2:12 AM

Former Member
0 Kudos
SELECT SINGLE objky FROM nast INTO w_obj WHERE objky = p_vbeln. 
.....
data: lv_vbuk type vbuk.
Select single *  from VBUK into ls_vbuk (structure of vbuk) where vbeln eq p_vbeln.  
if ls_vbuk-cmgst eq 'B'.
etc...

or 
data Lv_cmgst type CMGST.
select single cmgst into lv_cmgst from vbuk
  where vben eq p_vbeln 
       and cmgst eq 'B'.
 if sy-subrc ne 0.
*
etc....

Edited by: BreakPoint on Apr 1, 2011 2:42 PM

Former Member
0 Kudos

Thank you Break Point

It works now.

Regards,

Carlos

Answers (0)