2007 Apr 04 1:42 PM
Hi Experts,
I am Deethya, i am new in ABAP .so now i am doing one ABAP Report object can anyone help me how to write ABAP REPORT, here i attached my requrirement plz give me some suggestion i will give good points because this is my first program.
Step 1:
Selection screen : Document Number ( Multiple Selection)
Step 2:
Select all lines from EKKO where ( BSART = ZFR or BSART = ZPA).Check document number if it was filling in selection screen
Step 3:
Select the first line from EKPO where EBELN = EKKO EBELN and
EKPO EPELP = 0010
Step 4:
EKPO LOEKZ is initial?
IF YES go to STEP 5
IF NO go to STEP 2
Step 5:
Select STPRS from MBEW where MATNR = EKPO MATNR and
BWKEY = EKPO WERKS.
Step 6:
Call function Z_BAPI_PO_CHANGE and the informed parameters are
Purchaseorder = EKKO EBELN,
POITEM po_item = EKPO EBELP,
POITEM net_price = MBEW STPRS,
POITEMX po_item = EKPO EBELP,
POITEMX net_price = X
Step 7:
This function will fill in the return table
Step 8:
Is there message type = E?
IF YES go to STEP 9
IF NO go to STEP 10
Step 9:
Create Log with following message :
Contract Number : EKKO-NUMBER : XXXX
Message : return-message ( this one we want to see in SM36)
Step 10:
Finish File
IF NO go to STEP 2
thanks and regards,
deethya
2007 Apr 04 2:51 PM
Hi,
Code is almost there in the given requirement itself. Any way have a look at the pseudo code.
data: i_ekko type standard table of ekko,
i_ekpo type standard table of ekpo.
data: w_ekko type ekko,
w_ekpo type ekpo.
data: v_stprs like mbew-stprs.
Select-options: s_vbeln for ekko-ebeln.
select * from EKKO into table i_ekko where ebeln in s_vbeln and ( BSART = 'ZFR' or BSART = 'ZPA' ).
if sy-subrc = 0.
select * from ekpo into table i_ekpo for all entries in i_ekko where ebeln = i_ekko-ebeln and epelp = '0010'.
if sy-subrc = 0.
loop at i_ekpo into w_ekpo.
if wa_ekpo-loekz is initial.
clear v_stprs.
Select STPRS from MBEW into v_stprs up to 1 rows where MATNR = EKPO MATNR and BWKEY = EKPO WERKS.
endselect.
if sy-subrc = 0.
* the function module u have provided is a 'Z' Function module. So, check the
* parameters and call the FM with appropriate records.
* After calling the function module, read the RETURN parameter with TYPE = 'E'.
If sy-subrc = 0.
* Write the log in appropriate format using WRITE statement
* if the program executes in background then the output will go to SM36 automatically.
endif.
endif.
else.
endif.
clear: w_ekpo.
endloop.
endif.
endif.
Hope this helps.
Regards,
Phani.
Hi Experts,
I am Deethya, i am new in ABAP .so now i am doing one ABAP Report object can anyone help me how to write ABAP REPORT, here i attached my requrirement plz give me some suggestion i will give good points because this is my first program.
Step 1:
Selection screen : Document Number ( Multiple Selection)
Step 2:
Select all lines from EKKO where ( BSART = ZFR or BSART = ZPA).Check document number if it was filling in selection screen
Step 3:
Select the first line from EKPO where EBELN = EKKO EBELN and
EKPO EPELP = 0010
Step 4:
EKPO LOEKZ is initial?
IF YES go to STEP 5
IF NO go to STEP 2
Step 5:
Select STPRS from MBEW where MATNR = EKPO MATNR and
BWKEY = EKPO WERKS.
Step 6:
Call function Z_BAPI_PO_CHANGE and the informed parameters are
Purchaseorder = EKKO EBELN,
POITEM po_item = EKPO EBELP,
POITEM net_price = MBEW STPRS,
POITEMX po_item = EKPO EBELP,
POITEMX net_price = X
Step 7:
This function will fill in the return table
Step 8:
Is there message type = E?
IF YES go to STEP 9
IF NO go to STEP 10
Step 9:
Create Log with following message :
Contract Number : EKKO-NUMBER : XXXX
Message : return-message ( this one we want to see in SM36)
Step 10:
Finish File
IF NO go to STEP 2
thanks and regards,
deethya
2007 Apr 04 2:51 PM
Hi,
Code is almost there in the given requirement itself. Any way have a look at the pseudo code.
data: i_ekko type standard table of ekko,
i_ekpo type standard table of ekpo.
data: w_ekko type ekko,
w_ekpo type ekpo.
data: v_stprs like mbew-stprs.
Select-options: s_vbeln for ekko-ebeln.
select * from EKKO into table i_ekko where ebeln in s_vbeln and ( BSART = 'ZFR' or BSART = 'ZPA' ).
if sy-subrc = 0.
select * from ekpo into table i_ekpo for all entries in i_ekko where ebeln = i_ekko-ebeln and epelp = '0010'.
if sy-subrc = 0.
loop at i_ekpo into w_ekpo.
if wa_ekpo-loekz is initial.
clear v_stprs.
Select STPRS from MBEW into v_stprs up to 1 rows where MATNR = EKPO MATNR and BWKEY = EKPO WERKS.
endselect.
if sy-subrc = 0.
* the function module u have provided is a 'Z' Function module. So, check the
* parameters and call the FM with appropriate records.
* After calling the function module, read the RETURN parameter with TYPE = 'E'.
If sy-subrc = 0.
* Write the log in appropriate format using WRITE statement
* if the program executes in background then the output will go to SM36 automatically.
endif.
endif.
else.
endif.
clear: w_ekpo.
endloop.
endif.
endif.
Hope this helps.
Regards,
Phani.
2007 Apr 05 5:54 AM
Have done some of your basic requirements. Please reward if useful
SELECTION-SCREEN BEGIN OF SCREEN 1001.
SELECT-OPTIONS S_EBELN FOR EKKO-EBELN.
DATA ITAB TYPE EKKO.
SELECT * FROM EKKO INTO CORRESPONDING FIELDS OF ITAB WHERE EBELN IN S_EBELN AND EKKO-EBELP = '0010'.
DATA LOEKZ TYPE EKPO-LOEKZ.
IF LOEKZ IS INITIAL
SELECT SINGLE STPRS FORM MBEW INTO DT_STPRS WHERE <CONDITION>
CALL FUNCTION (FUNCTION IS CALLED BY CLICKING ON PATTERN.)
ENDIF.
2007 Apr 05 6:28 AM
**DO THE REQUIRED DATA DECLARATION***
selection-screen begin OF BLCK B1 WITH FRAME TITLE TEXT-001.
SELECT-OPTIONS: S_DOC FOR TABLENAME-FIELD(DOCNU).
SELECTION-SCREEN END OF BLOCK B1.
START-OF-SELECTION.
SELECT * FROM EKKO
INTO TABLE IT_EKKO
WHERE DOCNO IN S_DOC
AND ( BSART = 'ZFR' 0R
BSART = 'ZPA').
SELECT * FROM EKPO
INTO TABLE IT_EKPO
FOR ALL ENTRIES IN IT_EKKO
WHERE EBELN = IT_EKKO-EBELN
AND EBELN = '0010'.
LOOP AT IT_EKPO INO WA_EKPO.
IF NOT IT_EKPO-LOEKZ IS INITIAL.
SELECT STPRS FROM MBEW
INTO V_STPRS
WHERE MATNR = WA_EKPO-MATNR AND
BWKEY = WA_EKPO-WERKS.
ELSE.
CALL FUNCTION MODULES AND PASS THE PARAAMETERS ACCORDINGLY.
IF SY-SUBRC <> 0.
Create Log with following message :
Contract Number : EKKO-NUMBER : XXXX
Message : return-message ( this one we want to see in SM36)
ELSE.
EXIT.
ENDIF.
ENDIF.
ENDLOOP.
2007 Apr 05 6:37 PM
hi experts,
thanks for your help.it's really help for my first Report progam.
thanks and regards,
deethya
| User | Count |
|---|---|
| 3 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |