cancel
Showing results for 
Search instead for 
Did you mean: 

Txn F.27 - Print Pgm RFKORD11

Former Member
0 Kudos

Hi,

We execute Txn F.27 to generate Customer statement.

Related Print pgm is RFKORD11 and the Custom Form is almost a copy of 'F140_CUS_STAT_02'.

In the custom Form, we need to get value of a field in KNKK and display some data in the Form.

Checked the print program and it does not have any reference to Table KNKK and since this is Standard SAP pgm, we cannot make any changes to get Table value in the form.

Could you please suggest as to how this requirement can be achieved?

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi Chandy80,

Can I know what field you need from the KNKK ....

Regards,

Suneel G

Former Member
0 Kudos

Hi Suneel,

The field is SBGRP from KNKK.

Regards,

Chandy

Former Member
0 Kudos

Hi Chandy,

I roughly gone thru the script and found way lets try whether you can get SBGRP value from KNKK.

In F140_CUS_STAT_02 this script in ADDRESS2 - Customer address for advice window we have a value

&DKADR-ADRNR&

By Passing ADRNR number to KNA1 table we will get KUNNR number and by passing this KUNNR to KNKK we can get SBGRP.

And this can be done as follows:

In Script ADDRESS2 Window

/: PERFORM GET_SBGRP IN PROGRAM Z_TEST

/: USING &DKADR-ADRNR&

/: CHANGING &V_SBGRP&

/: ENDPERFORM.

Use/Print the value like this in script

p1 &V_SBGRP&

Then create a z_test program of type sub routine pool program.

FORM get_sbgrp TABLES input_tab STRUCTURE itcsy

output_tab STRUCTURE itcsy.

DATA: V_SBGRP TYPE KNKK-SBGRP,

lv_kunnr TYPE KNA1-KUNNR.

READ TABLE input_tab WITH KEY name = 'DKADR-ADRNR'.

IF sy-subrc = 0.

lv_adrnr = input_tab-value.

Select SINGLE KUNNR from KNA1 into lv_KUNNR where ADRNR = lv_adrnr.

IF sy-subrc = 0.

Select SINGLE SBGRP from KNKK into V_SBGRP where KUNNR = lv_kunnr.

ENDIF.

ENDIF.

READ TABLE output_tab WITH KEY name = 'V_SBGRP'.

IF SY-SUBRC = 0.

output_tab-value = V_SBGRP.

MODIFY output_tab TRANSPORTING value

WHERE name = 'V_SBGRP'.

ENDIF.

ENDFORM.

Regards,

Suneel G

Answers (0)