cancel
Showing results for 
Search instead for 
Did you mean: 

SD facility

Former Member
0 Kudos

Hi!

I have found this code right here:

http://www.sap-basis-abap.com/sapab025.htm

It is very useful particular for SD purposes . Please can somebody

try to fix the error to get it working. There is an internal table missing.

Regards

Ilhan

select * from ekko. 
       select * from konv where knumv = ekko-knumv 
           "Get all the condition records for the purchase order 
       endselect. 
endselect. 
 
* Get the info record conditions record 
* First declare the record structure for the key 
data: begin of int_konp, 
             txt1(5), 
             lifnr(5), 
             matnr(18), 
             txt2(4), 
             txt3(1), 
        end of int_konp. 
 
clear: konh, konp, int_konp. 
 
* data for the record key konh-vakey 
int_konp-txt1    = '00000'. 
int_konp-lifnr    = ekko-lifnr+5(5). 
int_konp-matnr = ekpo-matnr(18). 
int_konp-txt2    = 'ALL'. 
int_konp-werks = ekpo-werks. 
int_konp-txt3    = '0'. 
 
select * from konh where      kschl = 'PB00'            "Conditions (Header) 
                                     and datab => p_datum.       "valid from date 
 
      if konh-vakey = int_konp.                                  "Conditions (Item) 
             select single * from konp where knumh = konh-knumh. 
             continue. 
      endif. 
 
endselect.

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Thank you very much but I don't get any results.

Regards

ilhan

Answers (1)

Answers (1)

Former Member
0 Kudos

Hi Ertas,

Check this code which does not have syntax errors. Bold lines are appended/commented code.

<b>tables: ekko,konv,konh,konp.</b>

<b>parameters: p_datum type sy-datum.</b>

select * from ekko.

select * from konv where knumv = ekko-knumv.

"Get all the condition records for the purchase order

endselect.

endselect.

  • Get the info record conditions record

  • First declare the record structure for the key

data: begin of int_konp,

txt1(5),

lifnr(5),

matnr(18),

txt2(4),

txt3(1),

end of int_konp.

clear: konh, konp, int_konp.

  • data for the record key konh-vakey

int_konp-txt1 = '00000'.

int_konp-lifnr = ekko-lifnr+5(5).

<b>*int_konp-matnr = ekpo-matnr(18).</b>

int_konp-txt2 = 'ALL'.

<b>*int_konp-werks = ekpo-werks.</b>

int_konp-txt3 = '0'.

select * from konh where kschl = 'PB00' "Conditions (Header)

and datab => p_datum. "valid from date

if konh-vakey = int_konp. "Conditions (Item)

select single * from konp where knumh = konh-knumh.

continue.

endif.

endselect.

Thanks,

Vinay