5 1 1 1 1 1 Rating 100% (1 Vote)
As promised today I'll put code for a method to reset the rejection of the Purchase requisition. Most of the code is the same like in the check method, in fact even the code is repeated again so you can use this one without checking if reset of rejection can be done or not.
 
Importing:

I_BANFN TYPE EBAN-BANFN -> Purchase Requistion number

Changing:

C_FACTORY TYPE REF TO IF_PURCHASE_REQ_FACTORY -> Purchase requisition factory

Exporting:

E_RESET TYPE FLAG -> Reset was successful

Exceptions:

HEADER_COULDNT_BE_CREATED
ERROR_DURING_RESET
CANNOT_RESET

Read more ...

1 1 1 1 1 Rating 0% (0 Votes)
In the previous article I've shown how to check if we can reset the rejection of the purchase requisition. In the same way you can check if rejection is allowed or if release is allowed or if reset of release is allowed. To do that you'll have to replace  following piece of code from previous example fo_releasable->is_reset_rej_allowed( )
 with one of the following:
  • fo_releasable->is_rejection_allowed( ) 
  • fo_releasable->is_release_allowed( )
  • fo_releasable->is_reset_rel_allowed( ) 
 
In next article I will show you how to reset the rejection of PR .
Add a comment

1 1 1 1 1 Rating 0% (0 Votes)
Working with Purchase Requisitions in ABAP is quite pleasant job, but sometimes it's not so easy like with other documents types. You cannot easily say if Requisition is rejected and can be reset by checking EBAN table. You have to use OO PR objects to be able to do so. Bellow you can find a method how to check if you can reset the rejection of the requisition done in the WF. 
 
Importing:

I_BANFN TYPE EBAN-BANFN ->Purchase Requisition Number

Exporting:

E_RESETABLE TYPE FLAG -> If rejection can be reset this parameter will be set to 'X'

Changing:

CO_FACTORY TYPE REF TO IF_PURCHASE_REQ_FACTORY -> Purchase requisition factory

Exception:

HEADER_COULDNT_BE_CREATED

Read more ...

1 1 1 1 1 Rating 0% (0 Votes)
We got all needed functions, so I'll give you an example how to call the methods correctly to get characteristics update window like this:
 
Program bellow is reading firstly the info about stored values in given characteristic and then throws an update screen. After exiting from the screen it's saving data to database.
Add a comment
Read more ...

1 1 1 1 1 Rating 0% (0 Votes)
Now it's time to save the values entered into database. I will use here previously created method to move data from reference structure to BAPI tables, then I will read values from database to see if something has changed with BAPI_OBJCL_GETDETAIL, then save the values with BAPI_OBJCL_CHANGE. Just one remark, you have to pass all values always to that FM!
 
Importing:

I_DATA TYPE DATA OPTIONAL
value( I_CHANGE_NUMBER ) TYPE BAPI1003_KEY-CHANGENUMBER OPTIONAL -> Change Number 

Exception:

NO_DATA  

Add a comment
Read more ...

1 1 1 1 1 Rating 0% (0 Votes)
Our characteristics update screen was displayed, data was changes so we need to read the reference data and put the values into BAPI structures in order to be able to save the values to database.
I will use here BAPI_CLASS_READ to read all possible characteristics and COC1_FEATURE_CHECK to get characteristic details.
 
Importing:

I_DATA TYPE REF TO DATA

Changing:

CT_OBJVALUESNUM TYPE TT_BAPI1003_ALLOC_VALUES_NUM
CT_OBJVALUESCHAR TYPE TT_BAPI1003_ALLOC_VALUES_CHAR
CT_OBJVALUESCURR TYPE TT_BAPI1003_ALLOC_VALUES_CURR

Exceptions:

NO_DATA_TO_PASS 

Add a comment
Read more ...

1 1 1 1 1 Rating 0% (0 Votes)
Now we're ready to build the data for screen output, call the update screen and then move the data back from screen to reference data. We will use here:
  • COC1_FEATURE_CHECK to get characteristic ID
  • CTMS_DDB_INIT to initialize memory 
  • CTMS_CLASS_DDB to put in memory classification settings
  • CTMS_DDB_SET_VAL_FROM_OBJECT to set values in update screen from existing object (option)
  • CTMS_DDB_SET_VALUE_INTERNAL to set values in update screen in case of using reference data structure
  • CTMS_DDB_SET_VALUE_ONLINE to call the update screen
  • CTMS_DDB_HAS_VALUES_INTERNAL to check and get the values from the update screen after user action
  • zcl_abapblog_com_classific=>create_structure_for_class to create reference data structure
  • zcl_abapblog_com_classific=>move_screen_val_to_ref_data to move screen values to reference data
  • zcl_abapblog_com_classific=>clear_initial_line_api_vari to delete initial line for multiple values characteristics
  • zcl_abapblog_com_classific=>move_ref_data_to_screen_val to move reference data to update screen values table
Read more ...

1 1 1 1 1 Rating 0% (0 Votes)
In previous article I've shown how to move characteristics from reference data to screen values table, this method is doing opposite way from screen values table to reference data structure.
 
Importing:

IT_VALUES TYPE TT_API_VALI -> screen values table
I_ATNAM TYPE API_VALI-ATNAM -> Characteristic Name

Changing:

C_DATA TYPE REF TO DATA

Exceptions:

NO_DATA_TO_CHANGE

Add a comment
Read more ...

ABAP Favorites Eclipse plugin

Drag to your running Eclipse* workspace. *Requires Eclipse Marketplace Client