cancel
Showing results for 
Search instead for 
Did you mean: 

Add fields into ZMEDRUCK

Former Member
0 Kudos

Dear Gurus,

form name: ZMEDRUCK copied from MEDRUCK

Report program: SAPFM06P

PO output type: NEU

Who released the purchase order? I want to add this field into ZMEDRUCK

(I tried to add CDHDR-USERNAME, But it is not showing).

Can anybody help me?

Bishnu

11/08

Accepted Solutions (1)

Accepted Solutions (1)

former_member203305
Active Contributor
0 Kudos

Hi

you need to use a code inside your form to get the name of the person who released the PO.

Find information about PERFORM in sapscript.

I give a hit.

in your form


/:	 	 DEFINE &L_NAME&
/:	 	 DEFINE &L_NAME2&
/:	 	 PERFORM GET_RELEASED IN PROGRAM ZMM_001
/:	 	 USING    &L_NAME&
/:	 	 CHANGING &L_NAME2&
/:	 	 ENDPERFORM

in se38,


 FORM GET_RELEASED TABLES input_table STRUCTURE itcsy
                          output_table STRUCTURE itcsy.

* Put your code here to get the released of the PO

ENDFORM.

Regards

Miguel

Former Member
0 Kudos

Dear Miguel,

Thanks for your kind reply. And please check my code.

Below the code I applied but yet not the result show in print:

PERFORM GETID IN PROGRAM ZCAL_PO_REL_ID

USING &EKKO-EBELN&

CHANGING &S_ID&

ENDPERFORM

&S_ID&

REPORT ZCALL_PO_REL_ID.

TABLES cdhdr.

FORM getid TABLES in_tab STRUCTURE ITCSY out_tab STRUCTURE ITCSY .

READ TABLE in_tab INDEX 1.

SELECT SINGLE * FROM cdhdr WHERE objectid = in_tab-value and tcode eq 'ME28'.

IF sy-subrc EQ 0.

READ TABLE out_tab INDEX 1.

MOVE cdhdr-username TO out_tab-value.

MODIFY out_tab INDEX 1.

ENDIF.

ENDFORM.

Former Member
0 Kudos

from your code, this

SELECT SINGLE * FROM cdhdr WHERE objectid = in_tab-value and tcode eq 'ME28'

. is obviously failing.

I can't try this out in my system....not a PP user, but wouldn't you want to check the system status for RELEASED (perhaps REL), and find the UNAME for the person who set that status? You could go to table JEST with the number of the status code for the REL text (from table TJ02/TJ02T), and/or table JCDS for the history of that status, to find out who made the change/set a particular status. Remember to check for the INACT = OFF...you don't want to report status settings that are not active.

And for your define, write the statement in the window where your perform would be called, like:

DEFINE &S_ID& = ' '

then your perform

Edited by: DaveL on Aug 15, 2011 5:14 PM

Answers (3)

Answers (3)

Former Member
0 Kudos

Dear All,

Now it is okay.

Thanks to everybody.

Former Member
0 Kudos

Hi,

Check EKKO-frgsx.

BR

Dep

Former Member
0 Kudos

Hi Bishnu,

pls check the link i hope this will help you.

Thanks,

Asraf Ali