‎2005 Dec 12 5:02 PM
i am print the item details in main window. for this i can write the external subroutine using itcsy structure.
but my problem is in which position i can call this subroutine in main window text editor.
(this script for rfq create , i was modify the Medruck layout set)
‎2005 Dec 12 5:23 PM
I think it depends on what you are trying to print (Purchase Order or RFQ or Outline Agreement or Scheduling Agreement)!
Purhase Order - <b>ITEM_HEADER_F</b>
Request For Quotation - <b>ITEM_HEADER_A</b>
Outline Agreement - <b>ITEM_HEADER_R</b>
Scheduling agreement delivery schedule - <b>ITEM_INFO_1
</b>
‎2005 Dec 12 5:07 PM
Hello
Why do want to call an external subroutine? I guess you want to perform some logic on a particular field and then print it out at the line item level. For this find the element which prints the line item details. Write the perform within this element and then print out your varible.
The driver program would loop through all the line items calling this elemnt in the Main window each time printing out the line item variables.
Hope this helps
Shounak
‎2005 Dec 12 5:11 PM
I am not sure about MEDRUCK ( I am a HR person). But you can call this subroutine anywhere (any window) before you access the variable from the subroutine.
Please find the sample coding which I used in HR to get the benefit area passing Personnel number.
Calling the subroutine from the main window:
/: PERFORM GET_BENEFIT_AREA IN PROGRAM ZHBNF_BEN_ENROLL
/: USING &P0001-PERNR&
/: CHANGING &P_BAREA&&
/: ENDPERFORM
/: IF &P_BAREA& EQ 'H1'
/: INCLUDE ZHEX-MACRO-H1LOGO OBJECT TEXT ID ST
/: ELSEIF &P_BAREA& EQ 'H2'
/: INCLUDE ZHEX-MACRO-H2LOGO OBJECT TEXT ID ST
/: ELSEIF &P_BAREA& EQ 'H3'
/: INCLUDE ZHEX-MACRO-H3LOGO OBJECT TEXT ID ST
/: ELSEIF &P_BAREA& EQ 'U1'
/: INCLUDE ZHEX-MACRO-U1LOGO OBJECT TEXT ID ST
/: ENDIF
Coding inthe external program:
&----
*& Form get_benefit_area
&----
This subroutine is used to determine benefit area
----
FORM get_benefit_area TABLES intab STRUCTURE itcsy
outtab STRUCTURE itcsy.
DATA: l_pernr TYPE p0001-pernr,
l_barea TYPE p0171-barea.
READ TABLE intab WITH KEY 'P0001-PERNR'.
CHECK sy-subrc = 0.
l_pernr = intab-value.
SELECT SINGLE barea INTO l_barea
FROM pa0171
WHERE pernr = l_pernr
AND begda <= sy-datum
AND endda >= sy-datum.
READ TABLE outtab WITH KEY 'P_BAREA'.
CHECK sy-subrc = 0.
IF sy-subrc = 0.
outtab-value+0(2) = l_barea.
MODIFY outtab INDEX sy-tabix.
ENDIF.
ENDFORM. "get_benefit_area
‎2005 Dec 12 5:13 PM
Hi Sonali,
You write the perform in the Element of the Window of the layout where you want the data & call that perform while creating a report program.
For example.
Write this as command in the Layout
PERFORM GET_SHIPTO IN PROGRAM Z_PERFORMS_PO
USING &EKPO-ADRNR& --->We will pass this value
CHANGING &V_NAME1&--->We will get this value
CHANGING &V_NAME2&--->We will get this value
Now create a report Z_PERFORMS_PO.
In that write the following code.
FORM GET_SHIPTO TABLES IN_TAB3 STRUCTURE ITCSY
OUT_TAB3 STRUCTURE ITCSY.
DATA: V_ADRNR LIKE ADRC-ADDRNUMBER.
READ TABLE IN_TAB3 INDEX 1.
CALL FUNCTION 'CONVERSION_EXIT_ALPHA_INPUT'
EXPORTING
INPUT = IN_TAB3-VALUE
IMPORTING
OUTPUT = V_ADRNR.
SELECT SINGLE * FROM ADRC
WHERE ADDRNUMBER = V_ADRNR.
IF SY-SUBRC = 0.
READ TABLE OUT_TAB3 INDEX 1.
WRITE ADRC-NAME1 TO OUT_TAB3-VALUE.
MODIFY OUT_TAB3 INDEX SY-TABIX.
READ TABLE OUT_TAB3 INDEX 2.
WRITE ADRC-NAME2 TO OUT_TAB3-VALUE.
MODIFY OUT_TAB3 INDEX SY-TABIX.
ENDIF.
ENDFORM. "get_shipto
‎2005 Dec 12 5:14 PM
Hello
In MEDRUCK the line item data are printed within the MAIN window in the elements starting with ITEM_*. Put your perform in one of these appropriate elements.
Shounak
‎2005 Dec 12 5:23 PM
I think it depends on what you are trying to print (Purchase Order or RFQ or Outline Agreement or Scheduling Agreement)!
Purhase Order - <b>ITEM_HEADER_F</b>
Request For Quotation - <b>ITEM_HEADER_A</b>
Outline Agreement - <b>ITEM_HEADER_R</b>
Scheduling agreement delivery schedule - <b>ITEM_INFO_1
</b>
‎2005 Dec 13 8:30 AM
hi,
my script for RFQ.
Request For Quotation - ITEM_HEADER_A ( u r give this text element). but in main window this text element was not available.
ITEM_LINE_A
ITEM_HEADER_R
these r available. which one is right one to display the item details in main window for Request For Quotation Output Create.
‎2005 Dec 13 5:02 PM