Regarding Number generation in a customized screen
Hi All,
I need to create a customized screen where after saving data a document no will be generated like PO/SO.
Please help me how to solve it.
Thanks
Debraj
Hi Debraj,
You can generate a sequential number when ever user saves the record using function module 'NUMBER_GET_NEXT'.
Firstly, Go to transaction SNRO and create a new Number range object. Here you can define the range of the numbers. say 'WXYZ'.
Pass this to the import parameter object of the function module.
CALL FUNCTION 'NUMBER_GET_NEXT'
EXPORTING
nr_range_nr = '01'
object = 'WXYZ'
IMPORTING
number = l_next_number
EXCEPTIONS
interval_not_found = 1
number_range_not_intern = 2
object_not_found = 3
quantity_is_0 = 4
quantity_is_not_1 = 5
interval_overflow = 6
buffer_overflow = 7
OTHERS = 8.
IF sy-subrc <> 0.
Do Nothing
ENDIF.
The export parameter 'number' gives us the next sequential number.
So when you click on save. Call this function module and get the next number and save it.
Hope this helps.
Do let me know in case you need any more details.
Regards,
Sravan Varagani
Similar Messages
-
Hi Experts,
I am SAP MDM Consultant and have recently come across this issue pertaining to number generation,need your expert guidance to solve it.
Problem Definition : In our landscape Number generation takes places through a BAPI function call to ECC system,This data is then filled in the form and then on submission data gets saved in MDM.Later the same gets syndicated to ECC after enrichment and approvals.Recently in dev system we have encountered Duplicate Vendor number in MDM system.MDM is not generating number,its the BAPI call from ECC which does this.I think some previously used numbers must have be released for use and the same has been used by BAPI.
So,can you please guide what can be reasons of inconsistent number generations and which methods are used to release the same unused numbers for use?
Quick help will be appreciated.
Thanks,
Ravi.I think some previously used numbers must have be released for use and the same has been used by BAPI.
SAP has no process to release old numbers,
There is a function module to get the next number: 'NUMBER_GET_NEXT'
It just uses the the number range number and the number range object and reads then the next number from the number range table NRIV.
Usually you cannot create duplicates, SAP ends in a dump.
So I guess your problem is created by either resetting the number range in ERP production system manually, or somebody transported the intervals from DEV to PROD system despite of the endless warnings, which obviously has then the lower current number as you usually have not as much materials in a DEV system like in a PROD system.
It can already be years ago that a number range was resetted, and you are just approaching numbers that are already used.
You have to analyze the numbers in MARA table and compare it with the number range intervals and their current number. -
How to Create an Custom Employee Number Generation ...
Dear Friends,
We are Implementing HRMS Suite Version12i, for one of the Client in Middle east.
One question about Custom Person Numbering.
How to create custom employee numbering Based on the User Person Type?
Example:
Two person types
o Permanent Employee
o Probationary employees
We Need to give two different numbering schemes for each person type.
eg Permanent Employee will use a seq begin 100000 whereas Probationary employees (other user type) will use a sequence beginning 200000.. Can any pls let me know how to handle the Custom Employee Number Generation (with Setups)
With regards
SwpanaHi,
Could you please help me to write/or send a sample of a Person Number Generation Formula.
I don't see the noteid : 279458.1 on metalink,I get the following message:
Article or Bug cannot be displayed. Possible reasons are:
The article Id or bug number was entered incorrectly. Please check and try again.
The article Id or bug number does not exist (was referenced incorrectly).
The article or bug is not classified as publicly accessible ("non-public").
The content is being updated and it is temporarily unavailable but will be made available again soon.
If you still have questions about why you could not access this article or bug, please use Feedback.
Please help!! -
Custom Employee Number Generation Using Fast Formulas
Hi,
I have a requirement to generate custom employee numbers like "EMP100001". we have already created a business group with the setting of Employee number generation as Automatic. but we need to generate custom employee number as Format given above instead of automatic number generation.
I have created my own PL/SQL Package to generate custom employee number as per Person Type. Also created a Fast Formula Function with the following parameters -
Name = Get_Custom_Number
Data Type = Text
Class = External Funtion
Alias Name = NULL or what you want the alias to be
Description = Returns the next custom number value
Definition = CUSTOM_EMP_NUMBER_GENERATION.Get_Custom_Number (PL/SQL Function)
Proving the following Context usages and Parameters details to the Fast Formula Function -
Context usages:-
Number = 1
Context Name = BUSINESS_GROUP_ID
Data Type = Number
Parameters as defined in PL/SQL function
1 p_legislation_code Text Input Only
2 p_person_type Text Input Only
3 p_person_number Text Input Only
4 p_party_id Number Input Only
5 p_person_id Number Input Only
6 p_national_id Text Input Only
7 p_date_of_birth Date Input Only
Than i created a Fast Formula using the following navigation
Total Compensation > Basic > Write Formula
with following details -
Name = EMP_NUMBER_GENERATION
Type = Person Number Generation
Description = Returns next Employee number
and wrote my formula code.
When i created a Employee from Enter and Maintain People screen it is showing automatic number instead of my custom employee number.
I m not able to find where i m missing the logic or some parameters?
If anyone has come across such situation, please provide some pointers here.
Thanks
RenuWhat is the application release?
Please review these docs and see if it helps.
Is it Possible to Update Generate Employee Number Method From Automatic to Manual? [ID 393827.1]
Need To Change The Employee Numbering From Automatic To Manual [ID 291634.1]
Unable to Switch From Auto to Manual for Employee Number Generation in Shared Hr [ID 452044.1]
How to Prefix a Zero on Custom Employee Numbers [ID 822425.1]
How To Implement Custom Person Numbering Using FastFormula Based on User Person Type Instead of System Person Type [ID 372696.1]
Thanks,
Hussein -
hai friends,
how to dispaly the ouput of ALV in Custom screen.
Regards,
selvamuthukumarHi,
Following Sample Code will help you in this way, i am using SCREEN 1 and SCREEN 2
Screen one there is a field where user enter the Number of Records he want to show from KNA1
than on SCREEN 2 there is CONTAINER where Record show as ALV
Flow Logic SCREEN 1
process before output.
module status_0001.
process after input.
module exit_command_0001 at exit-command.
chain.
field: tf_rec_no.
module user_command_0001.
endchain.
Flow Logic SCREEN 2
process before output.
module status_0002.
module display_alv.
process after input.
module exit_command_0002 at exit-command.
module user_command_0002.
report zfsl_rget_from_kna1_scr_class.
tables: kna1, zsdo.
data: tf_rec_no(10).
*PARAMETERS: ptablen(10).
data: git_kna1 like standard table of kna1 with header line,
wa_git_kna1 like kna1,
go_grid type ref to cl_gui_alv_grid,
go_custom_container type ref to cl_gui_custom_container.
call screen 1.
*& Module STATUS_0001 OUTPUT
* text
module status_0001 output.
set pf-status 'ZFSL_KNA1_SCR_CLASS'.
* SET TITLEBAR 'xxx'.
endmodule. " STATUS_0001 OUTPUT
*& Module USER_COMMAND_0001 INPUT
* text
module user_command_0001 input.
if tf_rec_no ca 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz-'.
message 'Please enter the Valid Number' type 'E'.
elseif tf_rec_no = 0 and tf_rec_no <> space.
message 'Please enter the Number other than 0 (ZERO)' type 'I'.
elseif tf_rec_no <> space.
clear: git_kna1[], git_kna1.
select * from kna1 up to tf_rec_no rows
into corresponding fields of table git_kna1.
if sy-subrc = 0.
modify screen .
call screen 2.
endif.
endif.
endmodule. " USER_COMMAND_0001 INPUT
*& Module exit_command INPUT
* text
module exit_command_0001 input.
data: ok_bt1 type sy-ucomm.
* ok_bt2 TYPE sy-ucomm.
case ok_bt1.
when 'BACK'.
clear ok_bt1.
leave to screen 0.
when 'EXIT'.
clear ok_bt1.
leave program.
when 'CANCEL'.
clear ok_bt1.
leave to transaction 'ZFSLSCB'.
endcase.
endmodule. " exit_command INPUT
*& Module STATUS_0002 OUTPUT
* text
module status_0002 output.
set pf-status 'ZFSL_KNA1_SCR_CLASS'.
* SET TITLEBAR 'xxx'.
*clear: go_custom_container.
* CALL METHOD go_grid->refresh_table_display.
if go_custom_container is initial.
create object go_custom_container
exporting
container_name = 'ALV_CONTAINER'.
create object go_grid
exporting
i_parent = go_custom_container.
endif.
perform load_data_into_grid.
endmodule. " STATUS_0002 OUTPUT
* MODULE exit_command_0002 INPUT
module exit_command_0002 input.
data: ok_bt2 type sy-ucomm.
* ok_bt2 TYPE sy-ucomm.
case ok_bt2.
when 'BACK'.
clear ok_bt1.
leave to screen 0.
when 'EXIT'.
clear ok_bt2.
leave program.
when 'CANCEL'.
clear ok_bt2.
leave to transaction 'ZFSLSCB'.
endcase.
endmodule. " exit_command INPUT
*& Module USER_COMMAND_0002 INPUT
* text
module user_command_0002 input.
endmodule. " USER_COMMAND_0002 INPUT
*& Form load_data_into_grid
* text
form load_data_into_grid.
* SELECT * FROM kna1 UP TO tf_rec_no ROWS
* INTO CORRESPONDING FIELDS OF TABLE git_kna1.
call method go_grid->set_table_for_first_display
exporting
i_structure_name = 'KNA1'
changing
it_outtab = git_kna1[].
endform. "load_data_into_grid
Please Reply if any Issue.
Kind Regards,
Faisal
Edited by: Faisal Altaf on Feb 17, 2009 7:28 PM -
Oracle Gurus,
Customer creation number generation as Automatic, where we are doing this setup in applications.
For supplier we give the setup in Financial options but I am not able to trace out for customer automatic number generation.
If anyone know the setups, please let me know the steps and setups.
Please advise.
Edited by: satish.ygl on 09-Sep-2012 19:21Hi Satish,
Set the sequence number
Pl. go thru following navaigation path :
Go to Application Developer responsibility >Menu > Application> Database > Sequence
Query on sequence RA_CUSTOMERS_NUM_S and set Start Value to 20000 .
Retest it.
HTH
Sanjay -
How to find a custom screen number
Hi friends,
I have to assign table maintenance generator for one of my custom table.
I need to give a screen number in the Table maintenance generator.
when i try to give screen 1011, it says it already exists and can not be used.
Probably i might have used 1011 as local object earlier.
Where can I see the screen 1011. (mostly custom screen)
I tried SE51, But it is asking program name as well.
Please let me know where to see the screen?
If i have created it as local object, i need to delete it.Hi reddy,
Thanks for your response.
I know the table generator process, But I want to use 1011, because I have only assigned it to one custom table and saved as local object.
Even though, i deleted those custom table, SAP not allowing me to use the screen number.
I have to use the same Screen number 1011, and can't use other.
I checked in Local objects folder in SE80, But nothing is there(as deleted custom table).
It looks simple, But taking more time to find it. -
Customer screen get populated in activity management
hi any one can help me out in this pls.
my client requirement is customer screen get populated in activity management.
my client using activities in crm.They configured customer sceen in activities.In that they have fields like contract validity, type of contract etc.
how it will get populated when they enter customer number.hi
can u please elaborate ur requirement what exactly we mean be population of activity screen,i din get exactly
best regards
ashish -
How to get the screen value to custom screen from standard screen
Hi all,
I have a standard screen which is attached to a standard function group and a custom screen which is attached to a custom function group... Now my requirement is to get some field values from the Std screen to my custom screen ...
I have used the FM DYNP_VALUES_READ but its resuts in error...
in my current screen PBO i called this FM and given the prog name as the Std pgm name which being created while creating the screen from the function group and the screen number as the standard screen number...
Eg : Standard Function gp = FSBP_02
Pgm name = SAPLFSBP_02
Screen Naumber = 0220
Custom screen = 9001
Pgn Name = zname
in 9001 PBo i called
DATA: IT_DYNPFIELDS TYPE TABLE OF DYNPREAD,
WA_DYNPFIELDS like line of IT_DYNPFIELDS.
WA_DYNPFIELDS-FIELDNAME = 'BP021-BUSINESS_Y'.
APPEND WA_DYNPFIELDS TO IT_DYNPFIELDS.
CALL FUNCTION 'DYNP_VALUES_READ'
EXPORTING
DYNAME = 'SAPLFSBP_02'
DYNUMB = '0220'
TRANSLATE_TO_UPPER = ' '
REQUEST = ' '
PERFORM_CONVERSION_EXITS = ' '
PERFORM_INPUT_CONVERSION = ' '
DETERMINE_LOOP_INDEX = ' '
START_SEARCH_IN_CURRENT_SCREEN = ' '
START_SEARCH_IN_MAIN_SCREEN = ' '
START_SEARCH_IN_STACKED_SCREEN = ' '
START_SEARCH_ON_SCR_STACKPOS = ' '
SEARCH_OWN_SUBSCREENS_FIRST = ' '
SEARCHPATH_OF_SUBSCREEN_AREAS = ' '
TABLES
DYNPFIELDS = IT_DYNPFIELDS
EXCEPTIONS
INVALID_ABAPWORKAREA = 1
INVALID_DYNPROFIELD = 2
INVALID_DYNPRONAME = 3
INVALID_DYNPRONUMMER = 4
INVALID_REQUEST = 5
NO_FIELDDESCRIPTION = 6
INVALID_PARAMETER = 7
UNDEFIND_ERROR = 8
DOUBLE_CONVERSION = 9
STEPL_NOT_FOUND = 10
OTHERS = 11
IF SY-SUBRC <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
How Can i get that... Its important ... Please help me...Hi,
Try with the below FM
RS_REFRESH_FROM_SELECTOPTIONS
in your custorm program, check the SY-CPROG and SY-XPROG values, for the standard program name or directly pass the importing parameter for the above FM as SAPLFSBP_02.
Regards
Bala Krishna -
How to make a field in custom screen as display field in screen exit
Hi ,
I have created a screen exit for CO02 with a field for item text in header level as input field , when value is given and save button is cliked it gets updated in database but the problem is same field shows as input field in CO03 ( display mode ) .
Code which i have used .
in PBO
if sy-tcode = 'CO03'.
loop at screen .
if screen-name cs 'SUBSCREEN' or screen-name cs 'RESB-POTX1'.
( subscreen - screen name given in screen editor and resb-potx1 field name given in screen editor )
SCREEN-INPUT = '0'.
modify screen.
endif.
endloop.
endif.
and even i tried in PAI too .....
if sy-tcode = 'CO01' or sy-tcode = 'CO02'.
update resb set POTX1 = RESB-POTX1
where aufnr = i_aufnr.
elseif sy-tcode = 'CO03'.
*oop at screen .
*f screen-name cs 'SUBSCREEN' or screen-name cs 'RESBD-SORTF'.
SCREEN-INPUT = '0'.
modify screen.
endif.
endloop.
endif.
but itshows as input field only ........how to make that custom field as display field in CO03HI Andy,
Try this out.
FIrst check the sy-dynnr, if it is same as your custom screen number
in PBO of your custom screen
if sy-dynnr = 'YOUR_NUMBER' and sy-tcode = 'CS03'.
loop at screen
if screen-name = 'YOUR_SCREEN_NAME'
screen-input = 0.
modify screen
endif
endloop.
endif.
if it wont work they try using Tcode SHD0
Hope this will serve your purpose.
Regards
Ramchander Rao.K -
Hi,
I have a question regarding search help on screen.
I have searched, but did not find anything for my requirement.
Here is my requirement...............
I have a drop down on one of the field of the custom screen. This dropdown has three items to choose from.
e.g.
Dropdown has PO, Reservation and Pcard.
And the other custom field is "Source". I want to put seach help on "Source" field.
So my requirement is to when user chooses PO in dropdown, they should get search help for PO on "Source" field.
And when user chooses Reservation in dropdown, they should get search help for Reservation on "Source" field.
Is it possible to that? If yes, then how should i proceed for that?
Any help would be appriciatable!!
Thanks in Advance .HI Varam.
Plesae copy this code and Paste in ABAP Editor and Format properly You will know it as it is appearing in Continuous Lines
And i dont know how to rectify it. Hopp you understand it
-->In Screen PVO
-->PROCESS ON VALUE-REQUEST.
--> FIELD Screen-Field MODULE f4_get.
-->in program
-->MODULE f4_get INPUT.
DATA : BEGIN OF f4_tab OCCURS 0,
define Required Fields here
END OF f4_tab.
GET CURSOR FIELD fnam VALUE fval.
DATA : dynpread TYPE TABLE OF dynpread WITH HEADER LINE.
refresh dynpread.
dynpread-fieldname = 'Screen-Field'.
APPEND dynpread.
CLEAR dynpread.
CALL FUNCTION 'DYNP_VALUES_READ'
EXPORTING
dyname = sy-repid
dynumb = sy-dynnr
TRANSLATE_TO_UPPER = ' '
REQUEST = ' '
PERFORM_CONVERSION_EXITS = ' '
PERFORM_INPUT_CONVERSION = ' '
DETERMINE_LOOP_INDEX = 'X'
START_SEARCH_IN_CURRENT_SCREEN = 'X'
START_SEARCH_IN_MAIN_SCREEN = 'X'
START_SEARCH_IN_STACKED_SCREEN = ' '
START_SEARCH_ON_SCR_STACKPOS = ' '
SEARCH_OWN_SUBSCREENS_FIRST = ' '
SEARCHPATH_OF_SUBSCREEN_AREAS = ' '
TABLES
dynpfields = dynpread
EXCEPTIONS
invalid_abapworkarea = 1
invalid_dynprofield = 2
invalid_dynproname = 3
invalid_dynpronummer = 4
invalid_request = 5
no_fielddescription = 6
invalid_parameter = 7
undefind_error = 8
double_conversion = 9
stepl_not_found = 10
OTHERS = 11
IF sy-subrc IS INITIAL.
READ TABLE dynpread WITH KEY fieldname = 'Screen-field'.
IF sy-subrc IS INITIAL.
SELECT Your Fields FROM Required FIelds
INTO TABLE f4_tab
WHERE Required Condions.
CALL FUNCTION 'F4IF_INT_TABLE_VALUE_REQUEST'
EXPORTING
DDIC_STRUCTURE = ' '
retfield = 'RETURN FIELD' To which the F4 value to be passed on to screen
PVALKEY = ' '
dynpprog = sy-repid
dynpnr = sy-dynnr
dynprofield = 'Screen-Field' --> All single Quote Values to be Capital Letters
STEPL = 0
WINDOW_TITLE =
VALUE = ' '
value_org = 'S'
MULTIPLE_CHOICE = ' '
DISPLAY = ' '
CALLBACK_PROGRAM = ' '
CALLBACK_FORM = ' '
MARK_TAB =
IMPORTING
USER_RESET =
TABLES
value_tab = f4_tab
FIELD_TAB =
RETURN_TAB =
DYNPFLD_MAPPING =
EXCEPTIONS
PARAMETER_ERROR = 1
NO_VALUES_FOUND = 2
OTHERS = 3
IF sy-subrc <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
ENDIF.
ENDIF.
ENDMODULE. " f4_get INPUT
Edited by: Ramchander Krishnamraju on Oct 31, 2009 4:32 AM -
In Executable program displaying results in custom screen.
Hi,
I have a executable program, when the program display's the out put of this program I need to display output in custom screen (like screen 100) instead of displaying in default List screen.
Can any one tell me how to create and display output in that screen.
Thanks.
Chris.Hi,
Check the pseudo code....
<b>Start-of-selection.</b>
Retrieve data
<b>End-of-seleciton</b>
call screen 0100.
<b>*PBO</b>
form PBO_200 output.
endform.
<b>*PAI</b>
FORM PAI_200 input.
endform.
To call Screens use any of the following commands
<u><b>1. CALL SCREEN scr.</b></u>
Addition:
... STARTING AT x1 y1 ... ENDING AT x2 y2
<b>Effect</b>
Calls the screen scr; scr is thenumber of a screen of the main program. You use SET SCREEN 0. orLEAVE SCREEN. to define thereturn from the CALL screen.
<b>Addition</b>
... STARTING AT x1 y1 ENDING AT x2 y2
<b>Effect</b>
The coordinates x1, y1 (start column andstart line in the window) and x2, y2 (end column and endline in the window) define the size and position of the CALLscreen ("top left - bottom right"). Besides these coordinates,you can also see the contents of the primary window, but cannot performany action there.
<b>Note</b>
If "ENDING AT ..." is not specified, suitablevalues are substituted for x2 and y2, taking into accountthe size of the called screen.
<b>Note</b>
<b>Runtime errors:</b>
DYNP_TOO_MANY_CALL_SCREENS: No further screen level (callscreen); the maximum number of nested screen levels is restricted to 50at present.
2. <u><b>SET SCREEN scr.</b></u>
<b>Effect</b>
In ABAP dialogs: Sets the number of the nextscreen.
Screen number scr is then processed when the current screen has finished.
<b>Example</b>
SET SCREEN 200.
<b>Notes</b>
To leave a CALL SCREEN chain or return to the application menu, use one of the followingstatements:
SET SCREEN 0. or LEAVE TO SCREEN 0.
I hope this solves your problem.
Regards,
Vara -
Reg:Table Control in Custom Screen
Hi All,
I am having a requirement of adding a custom screen in vendor master,interms of adding field i done it successfully by using BADI's,but now i added a table control in the custom screen,now whenever am trying to create a new vendor its showing vendor successfully created for the company code,but if i try to open any transaction after that am getting an error like "Express document "Update was terminated" received from author "Reference User Development"" , and if i go for transcation code XK03 if i try to open the particular vendor its showing error "Vendor has not been created".
Regards
ArpitamHi Suchithra,
For each and every fields in the screen will have by default properties as Group number which Group1 and Group3 but when u create a table control manually you might have forgot to maintain the the Group number details because of which it is showing in display rather in change.
Please maintain the Group details in screen field properties and check. I think it will work.
Regards,
Aditya. -
Latest recommendation for custom screen development?
easy points here - get 'em while their hot! : )
I'm trying to confirm my thoughts/assumptions on the development of custom screens. We are installing the various pieces of NW04s and expect the majority of our users to access ECC transactions through the SAP Portal (using Web GUI for HTML). Also, we will have a significant number of custom screen requirements; some may be enhancements to existing SAP delivered screens; others may be new screen development.
What is SAP's latest recommendation for custom screen development?
More specifically, what are various options and their advantages and disadvantages?
For example:
**Web Dynpro for Java
+ easy Portal integration
- requires NW Dev Studio/Infrastructure
**Web Dynpro for Java
+ Development tools within Workbench
- more difficult to integrate in the Portal
**Z transaction development with Screen Painter
**HTML/JavaScript or similar
etc....
Thanks,
BrianBrian,
For me , I have only two choices
1. Web Dynpro for Java
Great front end IDE to work with, only issue could be the performance issue, while Java is trying to communicate with SAP ECC.
2. Web Dynpro for ABAP
Relatively new, however a good tool to work with. Performance improvement compared to Java Web Dynpro.
I don't think you should have a concern of integrating this with Portal, as you have a separate iView for ABA Web Dynpro. The screen can be developed on the SAP ECC and then can be called from the Portal screen.
You still have other options like developing normal dynpro - but that will not give a look and feel of the web interface. BSP / PCUI are the other choices but given the roadmap of SAP for UI, I would stick to Web Dynpro for ABAP / Java.
Please let me know if you have any questions.
Regards,
Ravi -
How to create PO through BAPI from custom screen
Hi SAP Technical Guru,
i am new to module pool programming.
i designed custom screen which is like TA me21n means it has one tabstrip and tablecontrol.
for header details(fields) at tab strip, and item detials(fields) at table control i used.
now i have to capture screen fields into FM bapi_po_create1 and update the database tables.
please suggest me how to create Purchase Order through BAPI FM.
regards,here is the sample code
*tables for passing podata to bapi
DATA : gt_header TYPE STANDARD TABLE OF bapimepoheader,
gt_headerx TYPE STANDARD TABLE OF bapimepoheaderx,
gt_item TYPE STANDARD TABLE OF bapimepoitem,
gt_itemx TYPE STANDARD TABLE OF bapimepoitemx,
gt_account TYPE STANDARD TABLE OF bapimepoaccount,
gt_accountx TYPE STANDARD TABLE OF bapimepoaccountx,
*tables used for passing custom field data to bapi
gt_custom TYPE STANDARD TABLE OF bapiparex,
gt_custdata_in TYPE STANDARD TABLE OF bapi_te_mepoaccounting,
gt_custdata_ix TYPE STANDARD TABLE OF bapi_te_mepoaccountingx,
*tables used for cathing messages returned by bapi
gt_return TYPE STANDARD TABLE OF bapiret2,
gt_return1 TYPE STANDARD TABLE OF bapiret2,
*Work area declaration for passing custom field data to bapi
w_custom LIKE LINE OF gt_custom,
w_custdata_in LIKE LINE OF gt_custdata_in,
w_custdata_ix LIKE LINE OF gt_custdata_ix,
*Work area declaration for passing podata to bapi
w_header LIKE LINE OF gt_header,
w_headerx LIKE LINE OF gt_headerx,
w_item LIKE LINE OF gt_item,
w_itemx LIKE LINE OF gt_itemx,
w_account LIKE LINE OF gt_account,
w_accountx LIKE LINE OF gt_accountx,
*work area declaration for cathing messages returned by bapi
w_return LIKE LINE OF gt_return,
w_return1 LIKE LINE OF gt_return1.
*populating po dat into internal tables
w_header-comp_code = 'PH02'.
w_header-doc_type = 'TEST'.
w_header-vendor = '0000600019'.
w_header-purch_org = 'PH02'.
w_header-pur_group = '901'.
w_headerx-comp_code = 'X'.
w_headerx-doc_type = 'X'.
w_headerx-vendor = 'X'.
w_headerx-purch_org = 'X'.
w_headerx-pur_group = 'X'.
w_item-po_item = '00001'.
w_item-short_text = 'test po'.
w_item-po_unit = 'CM'.
w_item-matl_group = '01'.
w_item-po_unit = 'EA'.
w_item-plant = 'PH02'.
w_item-quantity = '1.000'.
w_item-net_price = '10.00'.
w_item-item_cat = '0'.
w_item-acctasscat = 'K'.
APPEND w_item TO gt_item.
w_itemx-po_item = '00001'.
w_itemx-short_text = 'X'.
w_itemx-matl_group = 'X'.
w_itemx-po_unit = 'X'.
w_itemx-plant = 'X'.
w_itemx-stge_loc = 'X'.
w_itemx-quantity = 'X'.
w_itemx-tax_code = 'X'.
w_itemx-net_price = 'X'.
w_itemx-item_cat = 'X'.
w_itemx-acctasscat = 'X'.
APPEND w_itemx TO gt_itemx.
w_account-po_item = '00001'.
w_account-serial_no = '01'.
w_account-quantity = '1.000'.
w_account-gl_account = '0000199999'.
w_account-costcenter = '0000400011'.
APPEND w_account TO gt_account.
w_accountx-po_item = '00001'.
w_accountx-serial_no = '01'.
w_accountx-quantity = 'X'.
w_accountx-gl_account = 'X'.
w_accountx-costcenter = 'X'.
APPEND w_accountx TO gt_accountx.
w_custdata_in-po_item = '00001'.
w_custdata_in-serial_no = '01'.
w_custdata_in-zzttry = '1000'.
w_custom-structure = 'BAPI_TE_MEPOACCOUNTING'.
MOVE w_custdata_in TO w_custom-valuepart1.
APPEND w_custom TO gt_custom.
w_custdata_ix-zzttry = 'X'.
w_custdata_ix-po_item = '00001'.
w_custdata_ix-serial_no = '01'.
w_custom-structure = 'BAPI_TE_MEPOACCOUNTINGX'.
MOVE w_custdata_ix TO w_custom-valuepart1.
APPEND w_custom TO gt_custom.
*bapi to create po oreders
CALL FUNCTION 'BAPI_PO_CREATE1'
EXPORTING
poheader = w_header
poheaderx = w_headerx
TABLES
return = gt_return
poitem = gt_item
poitemx = gt_itemx
poaccount = gt_account
poaccountx = gt_accountx
extensionin = gt_custom.
*bapi for po data commit
CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'
EXPORTING
wait = ' '
IMPORTING
return = w_return1.
*clearing tables & work area
REFRESH:gt_account,gt_item,gt_itemx,gt_accountx.
CLEAR:w_header,w_headerx.
*displaying message returned by bapi
LOOP AT gt_return INTO w_return.
WRITE: w_return-type , w_return-id , w_return-number , w_return-message .
ENDLOOP.
Maybe you are looking for
-
My iphone 5 touch screen seems to have a mind of its own. Please help
My iphone 5 touch screen seems to have a mind of it's own. Whilst I am trying to type a text message it will quite often whilst i'm tapping on letters, typr different letters, or open up the edit messages to select and delete messages. The screen can
-
MS SQL Server 7.0 Connectivity problems
Hello, I am creating applets which display information taken in a MS SQL Server 7.0. My SQL requests are very simple. I program with JBuilder 3.5. As a new Java programer, I have some basic problems: -1- Do I have to GET the JDBC/ODBC driver? or is t
-
Previous discussions on this forum regarding Spotlight's inconsistent ability to find files caused me to disable Spotlight (using Spotless) and use Easy Find to find things. No one warned me that disabling Spotlight would interfere with smart folders
-
Please could anybody tell me how to stop the rainbow wheel from turning
i sem to have a start up disk full prob but no other mac as target mode, just PC and an external hard disk thanks it is becomeming alarmingly urgent
-
Hi, How I can ENcrypt stored procedure in oracle? Thanks.